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

Add a constant force in Unity2D

$
0
0
I have a ball and I want to move it on the X axis, so, in the FixedUpdate method I added a force: `rigidbody2D.AddForce(Vector2.right * speed);` The ball's speed increases because of this code I wrote. I want to make this force to be constant, so the ball's speed not to increase. How can I do that? Thanks a lot!

Viewing all articles
Browse latest Browse all 1264


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