I have a dynamic body and in my update loop when I use SetLinearVelocity I am able to move it, however when I use ApplyForce the body won’t move at all. Is there something I’m missing in regards to applying a force to a b2DynamicBody?
var force:b2Vec2 = new b2Vec2();
if (keyIsDown(Keys.S)) force.y = 6;
if (keyIsDown(Keys.A)) force.x = -6;
if (keyIsDown(Keys.D)) force.x = 6;
_body.SetAwake(true);
if (force.x != 0 || force.y != 0)
_body.ApplyForce(force, _body.GetPosition());
Thanks in advance.
Is this code in your update function? Did you make sure force is set to 6?
I would also make sure the force is big enough to move the object. Maybe increase it to 60 or 600 and see if it makes a difference. If the friction is high small forces won’t move objects.