applyImpulse is not working

Hi there,

Can anyone help me out with this issue?

applyImpulse function on a rigidBody isn’t working for me. Basically, I have both RigidBody and Collision component added to a character. Can’t get the character to move forward. See code below.

Project Settings
Gravity.y = -100
Player mass = 10

var this.moveImpulse = 5;

this.entity.rigidbody.activate();
this.entity.rigidbody.applyImpulse(x * this.moveImpulse, y * this.moveImpulse, 0);

x value changes based on speed value which can be either -1, 1 or 0 when the key is pressed.

Is the rigidbody set to “Dynamic”?
Try making the impulse very large?

You can remove the call to activate() that’s done inside applyImpulse anyway.

Yeah, rigidbody is set to dynamic and I just tried
this.moveImpulse = 300000; :smile:

Still no movement.

linearDamping set to 1?

yeah, could you take a look?

I mean the linear damping is set to 1 on your player. If you change it to 0 does it work?

yeah, it’s working. thanks.