If the distance is excessively large when forcing the collider of a dead character to follow the body, the collider is teleported instead of moving it by setting the velocity. + More physics error logging
This commit is contained in:
@@ -64,8 +64,16 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
Collider.LinearVelocity = (MainLimb.SimPosition - Collider.SimPosition) * 60.0f;
|
||||
Collider.SmoothRotate(MainLimb.Rotation);
|
||||
Vector2 diff = (MainLimb.SimPosition - Collider.SimPosition);
|
||||
if (diff.LengthSquared() > 10.0f * 10.0f)
|
||||
{
|
||||
Collider.SetTransform(MainLimb.SimPosition, MainLimb.Rotation);
|
||||
}
|
||||
else
|
||||
{
|
||||
Collider.LinearVelocity = diff * 60.0f;
|
||||
Collider.SmoothRotate(MainLimb.Rotation);
|
||||
}
|
||||
}
|
||||
|
||||
if (character.IsDead && deathAnimTimer < deathAnimDuration)
|
||||
|
||||
Reference in New Issue
Block a user