Forum rules - please read before posting.

Object Teleport: Position relative to Active Camera - Question!

I have been searching for clarification on this setting for a few days, and haven't found it in writing anywhere. I am working on a 3D first person game, and want to be able to click on an object, and then have it appear in front of the player (camera/controls freeze during this up close view), and then with a click we are returned to the game, either with the object returning to its position, or being added to the inventory. The majority of this is pretty straight forward, but I'm having trouble with the popping up in front of the camera - whether a 2D image, or an actual 3D model appearing frozen in front of the player (latter is preferred), I am having difficulty nailing it. I believe the "object teleport position relative to active camera" is the ideal method, but I can't quite find a quantification of how to ensure the relative position, or how this feature is best used, just that the position shall be relative. I found the "examining objects up close" tutorial, which fully explains the Gone Home style of picking up and turning objects about - but I don't need that level of complexity, I just need a still, up close view with one click.

Any help would be greatly appreciated! Thanks all!

Comments

  • edited May 2021

    Teleporting an object relative to the active camera will cause the object's new position to be relative to it, in the camera's local space.

    For an example, let's say the position you directly assign in the Action is (1, 2, 3). With no relative position, the object will appear at (1, 2, 3), world-space co-ordinates.

    If, however, you make this relative to the camera, it'll appear 1 unit to the right of the camera, 2 units above the camera, and 3 units in front of the camera.

    So, if you want the object to appear 1 unit in front of the camera, teleport it to (0, 0, 1).

    Alternatively, you can parent a Marker to your MainCamera that's in front of it, and just teleport the object to the Marker directly.

  • Ah ok, it's simpler than I was making it. Thank you! A further, slightly separate but related question... I also want to make words appear in front of the 1st person camera, that move with the player. So: user clicks on object, words pop up for a few seconds, and no matter where user looks, the words are stuck in front of the camera. Signs point to needing a script for this... but just curious if there are built in Adventure Creator functions I'm missing to create this effect. I've attached animated words to the player camera, and I basically just need to enable the object/turn them on - can I do that with already existing Actionlist functions or do I need to write a script? Sorry for the total newb questions, I'm well aware many could have written a script to solve the problem in far less time than it is taking me to ask. But thank you @ChrisIceBox for your patience and thoroughness!

  • What component(s) exactly are you using in the scene?

    If a Renderer is involved, you can use the Object: Set visibility Action. Otherwise, you may be able to use the Object: Animate Action - if you can create animations that control the text visibility.

    For text to appear in a fixed position on-screen, it's normally enough to use a Menu and/or Unity UI - I'm not clear on the need here for it to be a separate 3D object.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.