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

How to set rigidbody force

$
0
0
Is there a way to set the force on an object in rigidbody2d, currently I'm using this but the speed constantly accelerates and decelerates. void FixedUpdate() { if (direction.magnitude != 0) { rb.AddForce(direction / 10, ForceMode2D.Impulse); } else { rb.velocity = Vector2.zero; } }

Viewing all articles
Browse latest Browse all 1264

Trending Articles



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