NPC's Velocity being Reverted In-Game

Hey there!
I’m trying to achieve a ragdoll launching effect on an npc when their health is set to zero. I have a ragdoll script that’s breaking all the joints, where I’m also applying linearVelocity on the head of the npc.

Here is how it looks in Studio:

AND HERE, is how it looks in-game (the problem):

The npc seems to apply the linearvelocity, but then revert back to its position with the velocity removed. I don’t know why this only happens in studio.

Anyone got ideas?

1 Like

It seems to be a ping issue? Maybe apply the velocity for a longer time?

1 Like

Its definitely not a ping issue.
I’ve tried applying force 500 times in a for loop with a small delay, and now I see a little movement in the rig, but it doesn’t always happen. Our of 3 rigs, only 1 actually moved when I loop-impulsed on death.

1 Like

@DrCherenkov It seems people are still having trouble.

Try adding a vectorforce pointing upwards so that the rig has 0 gravity effecting it.

1 Like

Can you send me the problematic model? I’d like to see if this is yet another manifestation of this issue or if we have a different problem. If it is the former, we do have a fix but unfortunately it breaks a significant number of existing models so we are still working on ways to roll it out with the least amount of disruption.

The ragdoll module seems to be replacing the original character model and cloning / positioning the ragdoll model to the position where the character’s ragdoll was initiated. If I recall, if you’re using the ragdoll module from community resources, it’s intended to clone and reposition the model.

There may be some latency between the ragdoll module and physics, but I would try to confirm that the NPC character is being replaced by selecting it before the ragdolling initializes. If the selection is deselected after the ragdoll starts, then the ragdoll is working as intended and you can try to wait for the ragdoll model to load before applying velocity.

Otherwise, I have no clue.

There actually was a problem with the ragdoll script. I don’t exactly know what. You’re right though, I used a ragdoll script from community resources.

A friend wrote a new ragdoll script for me, which responds very well to physics and impulse forces.

The old ragdoll script didn’t support any kind of physics. LinearVelocity, AngularVelocity, :ApplyImpulse(), .Velocity, .AssemblyLinearVelocity and all the other BodyMovers.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.