x


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

more ▼

asked Jun 28 '11 at 04:46 AM

Grady gravatar image

Grady
1.1k 66 70 82

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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).

more ▼

answered Jun 28 '11 at 04:58 AM

Dreamblur gravatar image

Dreamblur
703 9 16 22

i'm not that good with scripting..... is there a tutorial or example anywhere???

-Thanks

Jun 28 '11 at 11:49 PM Grady

a tutorial for that specific thing you want to do? not likely. There are plenty of tutorials that will teach you the basics, which is all you need for something like this. So that would be what I recommend.

Jun 28 '11 at 11:57 PM testure
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x804
x798
x286
x32
x17

asked: Jun 28 '11 at 04:46 AM

Seen: 1153 times

Last Updated: Jun 28 '11 at 11:57 PM