- Home /
Mouse movement and click effect
First off I appreciate any help. I am a complete newbie to this. I am attempting to create a game and I need help. I have an object that I want to control with my mouse movements, how do I accomplish this? Also, I want to make it so the initial mouse click, and initial mouse click only, activates a ball to move in one direction.
Again I appreciate any help. Thanks :)
Answer by FLASHDENMARK · Apr 19, 2011 at 08:17 PM
function Update () { var horizontalSpeed = Input.GetAxis("Mouse X");
var verticalSpeed = Input.GetAxis("Mouse Y");
transform.Translate(Vector3(horizontalSpeed ,0 ,verticalSpeed)); }
This will rotate your ball using your mouse. Please tell me if this gives you any errors if so I will look at it tomorrow :)
I keep getting an error 'Input Axis $$anonymous$$OUSE X is not setup.'
Ups, I miss-spelled $$anonymous$$ouse X and $$anonymous$$ouse Y. It should be fixed now. :)
Your answer
Follow this Question
Related Questions
Camera movement question 1 Answer
Problem with click-to-move script 0 Answers
Move Camera According to Mouse Movement While Button is Pressed 1 Answer
How to prevent 2d objects go over each other? 1 Answer
Mouse plane does not detect height 1 Answer