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

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

Open
EHu123 opened this issue Sep 18, 2024 · 0 comments
Labels
🪲 bug Something isn't working

Comments

@EHu123
Copy link

EHu123 commented Sep 18, 2024

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.

@EHu123 EHu123 added the 🪲 bug Something isn't working label Sep 18, 2024
@EHu123 EHu123 changed the title isPlaying for an Object is set to False when Selected the Same Object isPlaying for an Object is set to False when the Same Object is Selected Sep 18, 2024
@EHu123 EHu123 changed the title isPlaying for an Object is set to False when the Same Object is Selected isPlaying for an Object is set to False when the Same Object is Selected and the Animation is Still Running Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪲 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant