- Home /
How to make a game objective pointer?
Hey everyone, I was wondering if anyone knew how to make a game objective pointer, so like a GUI arrow at the top of the screen that points in the direction that the player would have to go to reach an objective.....
Any answers are appreciated!!!!!!
-Grady
Answer by Dreamblur · Jun 28, 2011 at 04:58 AM
First, get the position of wherever the objective is. Then, subtract the position of your character from that position to get the direction vector. Then, depending on the direction vector, switch the texture being displayed (if you have multiple images representing different directions) or rotate the texture using GUIUtility.RotateAroundPivot (if you just have one texture for the arrow and are displaying it using OnGUI).
i'm not that good with scripting..... is there a tutorial or example anywhere???
-Thanks
a tutorial for that specific thing you want to do? not likely. There are plenty of tutorials that will $$anonymous$$ch you the basics, which is all you need for something like this. So that would be what I recommend.