- Home /
Get Rigidbody Velocity
I am using:
rb.position += someVelocity * Time.deltaTime
to set the velocity. I think this the reason for rigidbody.velocity not returning the x component.
So, is there a way to compute it?
Answer by VeryAnnoyingCat · Jan 01, 2021 at 04:25 PM
Turns out I am just dumb. I am setting the velocity then trying to compute it.
The answer is to add the velocity I am setting with the gravitational forces acting on it which is rigidbody.velocity(.y). Since I need only the x component and the x and y displacements are independent in particle motion, I only need someVelocity.x.
Your answer
Follow this Question
Related Questions
Scaling an object causes slow movement (Since Update 5.5.4) 1 Answer
Rigidbody2D velocity changes when moving through a platform collider. 1 Answer
How to move a rigidbody2D at a constant speed without AddForce? 1 Answer
After AddTorque, the resulting angularVelocity depends of the RigidBody's velocity? 0 Answers
Getting the future position of a rigidbody2D with velocity 0 Answers