- Home /
Adding force to rigidbody2d to slide
Hello, I'm having problems adding force to rigidbody2d properly, the effect I want to achieve is to add a forward forward to my rigidbody2d to make it slide forward, sometimes the rigidbody slides, sometimes it makes a sudden jerk forward and stopped.
Is there anyway to ensure that the rigidbody slides everytime I apply a force to it?
As of now i'm using
rigidbody2d.velocity = new Vector2D(10,0)
to create a push forward everytime I press a button (for example spacebar).
Answer by superluigi · Jan 05, 2014 at 09:39 AM
Did you just answer your own question in the title? Anyway you can try rigidbody.AddForce.
Also if it's getting stuck sometimes it's probably the collider. Generally you want to have something round at your characters feet so the slide smoothly even if there's little gaps on the ground.
Your answer
Follow this Question
Related Questions
Rigidbody2D.velocity.x not working but Y does 0 Answers
Convert Force into Velocity for 2D Player Jump 0 Answers
Rigidbody2D.velocity out of controll 3 Answers
Deteriorating force on object? 0 Answers