Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Velocity is always zero when using easeTo #1638

Closed
apaatsio opened this issue Sep 10, 2020 · 1 comment · Fixed by #1640
Closed

Velocity is always zero when using easeTo #1638

apaatsio opened this issue Sep 10, 2020 · 1 comment · Fixed by #1640
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior

Comments

@apaatsio
Copy link

When using easeTo, the velocity of the body is not updated but it stays 0.

This behavior differs from moveTo. I would expect them to behave in a similar way. Moreover, the actor is clearly moving so it should have a velocity, right?

Steps to Reproduce

See https://codepen.io/apaatsio/pen/bGpvvwr

Basically just call this.actions.easeTo() on any actor and observe this.body.vel.

Expected Result

this.body.vel reflects the speed of the body.

Actual Result

this.body.vel is always (0, 0).

Environment

  • browsers and versions: Chrome 85
  • operating system: Linux
  • Excalibur versions: 0.24.5
@eonarheim
Copy link
Member

@apaatsio Good find, that is indeed inconsistent. Velocity is probably more ideal in general than altering position directly in the easing function...

@eonarheim eonarheim added the bug This issue describes undesirable, incorrect, or unexpected behavior label Sep 10, 2020
eonarheim added a commit that referenced this issue Sep 12, 2020
Closes #1638 

## Changes:

- Calculate the equivalent velocity needed to lerp instead of directly setting position
- Added tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants