Skip to content

Actor.actions.moveTo overshooting with when speed is high? #2944

Discussion options

You must be logged in to vote

Hi @maximilianschmitt

Thanks for the kind words! 🥰

I'm pretty sure I know why this is happening. The actions system sets the velocity of the actor to move it forward, but the simulation is discrete so each frame the actor will move by velocity pixels/second, the action system then checks if the actor has traversed far enough then snaps to the target destination causing the overshoot. The reason Excalibur uses the motion simulation and not exact positioning is so that it plays nice with the impulse based collision system (but perhaps we should make that configurable or re-evaluate that decision?). Here are the guts of the moveTo implementation

  public update(_delta: number): void {
    if (!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@maximilianschmitt
Comment options

Answer selected by maximilianschmitt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants