Arrow distance helper

Hello everybody:

im new for unity3d and i have some troubles with a mechanic.
I want to do an arrow that can helps the player to know where he should go. Like in crazy taxi.
I’ve been watching a lot of videos and reading the unity documentation. My game is in 3d and i want this arrow in my 2d HUD. How can i do this?

Sorry for the bad english and thank you for reading this post.

Are you asking about the code itself where the arrow points towards a specific location? Or the actual placement of it in the GUI? The object itself is clearly just a 3D model of an arrow, I know the kind of stuff you’re talking about, it should just be a case of positioning your arrow in the place you want and making sure it’s the child of a canvas. Simply use the game view to double check if everything is showing up correctly.

If you’re talking about the code a really simple form of this type of arrow thing would be to get the 3D arrow model, place an empty gameobject at the very tip of the arrow and make the arrow a child of that, then you would have to make use of Quaternion.LookRotation I believe and have it point towards your intended waypoint or target.

If you want to create a smooth effect with this code then look up Lerp or Slerp.

my game is about solar system and i have a map to about it, planets are pretty far away and they are moving constantly like the real solar sytem. And i want that when a player click the planet in the map, it appears an arrow like in crazy taxi with the distance between the player and the planet.