- Home /
How to move forward constantly and right left when it's necessary
Hello, I am developing an endless runner style game, the character will always go forward, there is no problem with this, I can do it as I want with addforce, but it does not go when it needs to go left and right. How can I do it using rigidbody and addforce.
rb.AddForce(new Vector3(Input.GetAxis("Horizontal"), transform.position.y, speed) * (Time.fixedDeltaTime * 2));
This is the last code I tried
Comment
Your answer
Follow this Question
Related Questions
Why object goes sometimes through walls by adding force ? 2 Answers
Jumping with rigid body3d 1 Answer
how get bow to add more force over time 0 Answers
Distribute terrain in zones 3 Answers
Why wont my character jump? (using rigidbody and addForce) 1 Answer