x


Attaching position of an object in game to position of cursor on screen

Hi, I have a character in 3rd person perspective. It shoots fireballs straight ahead of it at all times. I would like to make it so that the aim box I am using moves in relation to where the cursor is on screen. For example, if I have the cursor in the centre, which i have indicated by a red dot as a GUI texture, then it shoots straight. If I move the cursor up, the aimbox moves up, causing it to fire upwards. The aim box, therefore, must be able to move with the character too. I was thinking of having it mapped to a plane located in front of the character, but I have no idea how to do it. And as a note, I prefer using JavaScript. Thanks in advance.

more ▼

asked Apr 01 '12 at 10:00 PM

DracoScorpius gravatar image

DracoScorpius
36 1 2 3

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

0 answers: sort voted first
Be the first one to answer this question
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:

x3314
x981
x329
x197

asked: Apr 01 '12 at 10:00 PM

Seen: 533 times

Last Updated: Apr 01 '12 at 10:00 PM