- Home /
rb.AddForce problem
Hello! I am trying to get an obstacle to fly through the air (2D) with rb.AddForce, but it takes a little bit to get to full speed. How do I make it to where when the obstacle spawns, it has a constant force and doesn't accelerate. Thanks.
Comment
Answer by Cherubini-Neto · Dec 29, 2017 at 01:50 AM
You could directly assign the velocity you want using rb.velocity = new Vector3(xVelocity, yVelocity, zVelocity);
.
See: https://docs.unity3d.com/ScriptReference/Rigidbody-velocity.html