I made a small paper “note” 3d model. I want the player to click on the note and have text appear. and Display an exit button when the player as finished reading
Any Ideas?
Hello there, OK, first you need to set a group with the next objects: Notes → Paper Note → UI Text (the paper and text are children from the Notes), then you need to attach a collider that fits the paper note size, this must to be in the hierarchy root (“Notes”) and need a component that detects when the user clicks on it, so, this way you can control if the user are allowed to edit or not the text content and if there’s showing / hidening a button to done with it, check the documentation about the UI in Unity, cheers.
If you don’t want to do these things with UI system (you said you had a note model), you could do it with a render texture and another camera in the scene. I used that approach for a project recently.
-
Put a camera in the scene. Make it a UI camera (Culling mask == UI … or you can use another layer if you prefer).
-
Create a render texture in your project. Set it as target texture on your new camera (everything that camera sees will become that texture).
-
Create a canvas in your scene. Under the RenderCamera, reference the camera you made. Now the UI elements under this canvas will be rendered by the camera to the texture.
-
Drag your render texture onto the note model in the scene. Unity will create a material for the render texture, and put that on your model.
Now you can add UI elements under the canvas (remember to set layer right) and manipulate them through scripts, and the result should be displayed on your note model.