Skip to content

isPlaying for an Object is set to False when the Same Object is Selected and the Animation is Still Running #435

@EHu123

Description

@EHu123

Describe the bug
When an object is selected during its animation, the isPlaying status for this object is set to false even though the object is still moving. This is undesired behavior because I have a condition for when the object stops moving but the condition is falsely triggered when the object is still running and selected

To Reproduce
Steps to reproduce the behavior:

  1. Create an object and give it an animation using followPath and playAnimation. (I am using the soldier example).
    2 Add a tooltip to the object. ( I have added a tooltip to my soldier example not sure if this might have an effect on the issue)
  2. Add an "isPlayingChanged" event listener to the object that logs what the current value of e.detail.isPlaying is.
  3. Select the object while the object is playing its animation. You should see that e.detail.isPlaying is now false even though the animation is still running.

Expected behavior
Expected isPlaying to return true regardless if object is selected or not while the animation for the object is still running.

Relevant Code or Code Sandbox

    tb.loadObj(modelOptions, function (model) {
       soldier = model.setCoords(route.features[0].geometry.coordinates[route.features[0].geometry.coordinates.length - 1]);
       soldier.addEventListener('IsPlayingChanged', onIsPlayingChanged, false);
       soldier.addTooltip("this is a tooltip", true);
 }
 function onIsPlayingChanged(eventArgs) {
   if (!eventArgs.detail.isPlaying) {
     console.log("is not playing");
   }

   else {
     console.log("is playing");
   }
   if (eventArgs.detail.selected) {
     console.log("selected");
   }
   else {
     console.log("unselected");
   }
   console.log("eventArgs.detail.isPlaying is ", eventArgs.detail.isPlaying);
   console.log("eventArgs.detail.selected is ", eventArgs.detail.selected);
 }

Console Results
eventArgs.detail.isPlaying is false
eventArgs.detail.selected is true

Screenshots
If applicable, add screenshots to help explain your problem.

  • [Version [e.g. 2.2.7]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🪲 bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions