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:
Meta Vens 2026-10-07 05:39:40 +02:00
commit 2cf980e353
2 changed files with 12 additions and 2 deletions

View file

@ -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;
}
}