Back to Browse

Endless Runner in Unity - Player Movement Tutorial

1.3K views
Mar 11, 2024
6:50

In this tutorial, I will teach you something different: an endless running game in Unity. It will be a 3D project that will teach you how to set up the project before adding the C# script. Then it will describe the basics of the player movement. Unlike other endless runners, this one will use the New Input System. If you need a detailed explanation for the input system, go to New Input System tutorial: https://youtu.be/3Ht8N4_Qct4 If you want the scripts, you can access them here: https://github.com/kozmobotgames/EndlessRunner To add endless movement to your player, you need to add rb.AddForce, which will be introduced with the player force. This is a parameter that automatically adds force to your rigidbody character. That force enables constant movement without stopping, you shouldn't add Time.deltaTime because it will become faster. With the new input system, you need to add left and right movement actions and they will tell the script to move your player left and right with direction force. I am sorry because I didn't add the part of making endless platform generation. Don't worry, that will be in the next tutorial. Support the Creator of Kozmobot on the social networks! CHECK OUT MY WEBSITE: http://kozmobot.com INSTAGRAM: https://www.instagram.com/kozmobot.channel TIKTOK: https://www.tiktok.com/@kozmobot.channel

Download

0 formats

No download links available.

Endless Runner in Unity - Player Movement Tutorial | NatokHD