Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

How to move forward constantly and right left when it's necessary

$
0
0
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

Viewing all articles
Browse latest Browse all 1264

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>