- Home /
Question by
agentmalibu · May 13 at 05:02 PM ·
rigidbody2dvelocity
I'm trying to predict the maximum velocity of my player object but i just cant find the formula
public void SetVelocityX(float velocity, float horizontalDamping)
{
if (!canMove) return;
workspace.Set(RB.velocity.x + velocity * InputHandler.NormInputX,
CurrentVelocity.y);
workspace.x += InputHandler.NormInputX;
workspace.x *= Mathf.Pow(1f - horizontalDamping, Time.deltaTime *
10f);
RB.velocity = workspace;
CurrentVelocity = workspace;
}
Comment
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