I need to know how to code:
-left and right movement
-jump
-and gravity
I’m using a cube right this second so that’s all I need for now.
That’s right, you guessed it. I want to make a platform game in unity similar to Super Mario World. I’m just starting to learn Unity and for now, I want to get used to it making platform games. It’s simpler than 3D so that’s where I’ll start.
The most simple movement is transform.translate. But i wouldnt recommend that one for a character since it doesnt play well with the Unity physics. For a character you have two choices. Physics based or based at the charactercontroller.
The scripting reference already comes with basic movement scripts for the Charactercontroller. SimpleMove method is without jumping. Move method is with jumping and gravity.
Physics based movement is a bit more complicated. Here you have to work with forces. And to setup the rigidbody is a special chapter too.