Unity Follow Mouse Script - Help Needed!

Nibbie
Posts: 3
Joined: 2011.07
Post: #1
I am currently working on a Unity project where I have to camera at an aerial view facing down to the character. I want the character to follow the mouse cursor without clicking the mouse. I cannot figure out a way to get the character to do so. Please Help!

Thank You,
gtarjohn
Quote this message in a reply
Member
Posts: 227
Joined: 2008.08
Post: #2
Even though a lot of people here use Unity, you might be better off posting this on the Unity forums, as they are likely to have both more people and more of a focus on Unity. (as well as answers to your question being more useful to people there)
Quote this message in a reply
Member
Posts: 27
Joined: 2011.07
Post: #3
Or if you can clarify more: is it an issue with the math involved, or just how to go about scripting it in unity?
Quote this message in a reply
Nibbie
Posts: 3
Joined: 2011.07
Post: #4
I have tried the Unity forums and nobody helped me... The problem is the script. I always have trouble with making the script to where you do not click to follow the mouse cursor.

Sincerely,
gtarjohn
Quote this message in a reply
Moderator
Posts: 437
Joined: 2002.09
Post: #5
Seems like you could just find a script where the character moves towards the click, such as the following:
http://www.unifycommunity.com/wiki/index...ck_To_Move
Then comment out the first line of the Update method:
// if(Input.GetKeyDown(KeyCode.Mouse0))

Measure twice, cut once, curse three or four times.
Quote this message in a reply
Nibbie
Posts: 3
Joined: 2011.07
Post: #6
Thanks for your help Matt!
Quote this message in a reply
Nibbie
Posts: 1
Joined: 2011.10
Post: #7
Yup the same problem is with me, I always get confused in script coding , its really irritating me ! whenever i need, I will go to hire someone else !
Quote this message in a reply
Post Reply