playcanvas / playcanvas/engine

Should Anim activeStateCurrentTime be capped between 0 and duration in a non looped stated?

Open
#4,404 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: animation
Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

Related thread: https://forum.playcanvas.com/t/feedback-animstategraph-reverse-animation-even-when-finished/26397

See project where an unloop state animation is playing forwards and backwards

https://playcanvas.com/project/954386/overview/animation-time-issue

The activeStateCurrentTime is going pass the bounds of 0 and duration which means when changing speeds to the opposite direction, it doesn't playback correctly

(Press Space to reverse direction of speed)

https://user-images.githubusercontent.com/16639049/177550543-45a06916-d102-4c4a-ba54-ff496d3ac7a5.mp4

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked PlayCanvas project and reproduce the unlooped animation that is reversed with Space, then consult the related forum thread for context. The fix is done when activeStateCurrentTime stays within 0 and duration and reversing playback behaves correctly at either bound.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.