Resetting momentum on an object after dropping

Hi guys, another question.

I’m looking into resetting an objects momentum as soon as the player drops it (removes the physics handle), i want to try and get this implemented because i dont want the player to be able to spin the camera quick enough that when they let go the object will just go flying through the air. i want more control and that’s why i plan on having the momentum of the object reset so it just drops to the floor and then i can get an actual poke/throw mechanic put in.

Any help with this would be great.

Thanks.

Hi LukePGM,

One possible solution I found was to add a SetAllPhysicsLinearVelocity node after you release the component.

You should have the variable for the Physics Object that is picked up set already. So you just have to plug that in. You will need to CastToPrimitiveComponent for it to work with the Linear Velocity node though.

Make sure to post back to let me know if this works for you.

TJ

Hi TJ, i’ve got this implemented and it works, however ive noticed that the objects rotation is still effected by the velocity of the player camera, so if i spin the camera quickly and then drop the box it will spin as it falls to the ground, is there a way to prevent the objects rotation from being changed by the velocity in which it moves?

Thanks a lot.

Okay, how about this.

  • After the CastToPrimitiveComponent set SimulatePhysics to off.

  • Then immedietly set it back to on (this will stop all velocity and rotation).

  • Add a slight impulse to get the physics to start again (this shouldn’t be neccessary but it is right now, this is a known issue that we are looking into).

You will still have a bounce on impact with the ground but that is just part of working with physics objects.

2 Likes

Yeah ive got this in and it works perfectly. Thanks a lot.