Unity C# Simple Movement Script

A fundamental element of any game or simulation is movement. This movement we can observe or control. It can be moving left right, up, down, jumping, double jumping, flying and any other movement we can imagine, even the ones that do not follow the laws of physics.

In this article I will try to present the basic script that will be able to move any object in the Unity engine.

Horizontal and Vertical Movement

Let’s start with simple horizontal and vertical movements.

Remember never to copy and paste code. Try to understand it, read the comments if necessary, and then write the code from scratch yourself. If you have further problems, see the Unity documentation.

This guide will be updated in the future with other examples of the basic movement.

Movement is one of the most important elements that defines the game mechanics, so it is essential to have proper knowledge of C# and MonoBehaviour base class to put every object of our Unity game or simulation into motion.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Damian Dąbrowski

Hi, I’m Damian, a Unity Software Engineer who loves building education and simulation games.