- Home /
Create pop menu Sims's style when click on 3d Character
I'm trying to build a game that uses a concept from the known game "The Sims". Right now I'm building the AI for a 3d Character, and I need the player to be able to tell where the character should go or do. I want to know the best ways to create a pop up menu with animations, kind of to show some choices, so that when the player clicks over the 3d Character he can pick wherever he wants to do. I know this must be using UI elements under a Canvas that's placed over the player. However I can not have 2 Canvas in a Scene and I don't know how to fix them to the character so that it moves with him. Thanks in advance.
Here you can see what I mean.
Answer by Fluffy_Kaeloky · Mar 22, 2019 at 05:39 PM
Besides a World Space Canvas, if you'd like to have a Screen Space one, you can use the camera's WorldToScreenPoint (https://docs.unity3d.com/ScriptReference/Camera.WorldToScreenPoint.html).
Just ensure that the model is on the screen, and update the canvas' position based on the 3d model position projected to screen space.
I had a similar issue with another kind of UI and ended up projecting the model's position to screen space using that.
Your answer
Follow this Question
Related Questions
rendering panel w/children 0 Answers
Panel rect transform is wierd 1 Answer
Post Processing not working in Canvas 1 Answer
Keeping relative size of UI elements without moving them 0 Answers
UI Fading in flicker 5.5 1 Answer