Hi, I’m a complete newb to both Unity and the forums, apologies if this has been answered a million times before.
I’m following the Unity Roll-a-Ball tutorial. I just got to the step where I add movement to the ball with a C# script. My script is verbatim the same as the one in the tutorial video, but my ball doesn’t respond to keyboard input.
I’ve already checked the Input manager, and the correct buttons are set up for the horizontal and vertical axes, and I made sure that my ball has a rigidbody and that the plane has a mesh collider. I’ve added a speed variable so I’m fairly certain the problem isn’t just incredibly slow movement. I also moved the ball up in the air, just to check that physics was working correctly. As expected the ball fell and landed on the plane.
Can anybody think of something basic I’ve forgotten? The videos don’t have a list of common mistakes or anything, and I’ve checked everything I know enough to check.
off the top of my head: - be sure the ball script is sitting on the ball gameobject - Rigidbody can't be Kinematic - None of the colliders can be triggers - put a 'Debug.Log("I moved!");' in your script to see if the script is executed - try exaggerating values (add force or velocity of 100000000). - uncheck all constraint checkboxes on the ball... - Try attaching your Monodevelop to Unity and setting a breakpoint on your relevant movement code to see with which vlaues it is executed
– joonturbo