I have a slowmo effect that triggers when the player kills characters. However, I get some physics issues when I do this!
Normally, my ragdolls act as they should. But if the timescale is lowered, my ragdolls “fly off” into a direction. Note that I am changing both timeScale and fixedDeltaTime, ensuring the latter is always timeScale * 0.02f.
Any ideas on why this happens?
I made a bunch of random shapes (with rigidbodies and colliders) and stacked them in a cloud above a cube, then put a script with this on it on the cube, so it would go slo-mo the instant the first object hit. Then all the object collisions happen and it all seems to behave.
void OnCollisionEnter( Collision col)
{
Time.timeScale = 0.1f;
Time.fixedDeltaTime = Time.timeScale * 0.02f;
}
It even seems fine when lots of stuff is bonking together on the ground.
I did get it to go a big woggy when I made some degenerate ragdolls, like with one limb 100x heavier than the other, but that’s to be expected. As long as your physics are reasonable, the slowdown effect should be fine.