- Home /
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.
Your answer
Follow this Question
Related Questions
Disable/enable script and animation when you move your mouse cursor 1 Answer
Invisible mouse script? 1 Answer
Shoot at Mouse Cursor 1 Answer
Shoot at mouse cursor 0 Answers
Raycast being weird 1 Answer