Entity.Acceleration puts back what a VelocityLimit removed: the ceiling is not a change of vector
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f9d4f60a9e
commit
2cf980e353
2 changed files with 12 additions and 2 deletions
|
|
@ -45,7 +45,11 @@ public class VelocityLimit : Behavior
|
|||
{
|
||||
Limit = Evaluate(_data.TopSpeed);
|
||||
if (length(Entity.Velocity) > Limit)
|
||||
Entity.Velocity = normalize(Entity.Velocity) * Limit;
|
||||
{
|
||||
var clamped = normalize(Entity.Velocity) * Limit;
|
||||
Entity.LimitClamp += Entity.Velocity - clamped;
|
||||
Entity.Velocity = clamped;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue