How can I get a player to move in one direction and around it in the same time unity 2D

I just startet on a endless runner game, what I want to do is that the player should run upward, but right now I cant figure out how the player can run upwards in the same direction, right now he runs out of the field, which he shouldnt. The idea is that the player stays in the same position, so the user just needs to jump and not steer the player. Hope its clear where I want to go :slight_smile:

So If I understand correctly what you want is your character to jump in the same way every time,

The probelm is that you are incremting the velocity in Y axis every time you use that code

I don’t know if this will work but try it

MyRigidBody.velocity = Vector3.up*speed;

However , If you are using gravity on rigidbody I recommend you to use MyRigidBody.AddForce() instead of setting the velocity of the rigid body, since you can use 1 time AddForce and it is done