- This topic has 6 replies, 2 voices, and was last updated 1 year, 5 months ago by Jeff Boone.
-
AuthorPosts
-
2023-06-26 at 1:40 pm #64838Jeff BooneCustomer
Hey yall, so am having a very strange and annoying problem. I will try the explain everything very simple
So I have a menu with 2 buttons. You click button 1 and you load gltfNo1. When gltfNo1 is loaded I display a new Animbutton. The Animbutton plays a different animation each time you click it. First click you play anim1, second click you play anim2, etc until anim7.
While you act these animated sequence steps, you can click another button to go to menu, and load gtlfNo2 or reload gltfNo1SO whats the problem:
if you quit the animate sequence mid way (if you wont finish all steps) by clicking the go home button, and then you load either gltfNo1 or gltfNo2 you will play anim1 and anim2 in the same by click the Animbutton once. After anim1 and anim 2 are played, if you click Animbutton once you play anim3 and anim4 at these same time. ALSO if you go home now, and select either gltfNo1 or glftNo2, and then click the Animbutton once you will play anim1 anim2 and anim3 at the same time.
etc etc etc and you will reach a point where you play the whole anim sequence of 7 total anims, by just one click.I am resetting the step_coount each time you click the go home button. Also I tried resetting it each time you will the load gltf, but same problem exist. What the heck is going on??? Let me know if you need any photos or code parts from the XML or images. Thaks so much!
2023-06-26 at 1:58 pm #64839kdvParticipantJust show your puzzles.
Most likely you created that wierd logic without debugging. And that’s the problem. Use the “print to console” puzzle to control every step…
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-06-26 at 2:43 pm #64847Jeff BooneCustomerHey! Thanks for posting! here are the most important parts:
Attachments:
You must be logged in to view attached files.2023-06-26 at 2:52 pm #64852kdvParticipantHere is you problem:
You create the same event listener for the same button every time you load .gltf. As a result you have several event listeneres working at once. Never do this way. Move that bunch of puzzles out. You need only one.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-06-26 at 2:58 pm #64855Jeff BooneCustomerOH MYYY
Thanks so much! So am unloading the gltf, but that doesn’t mean much right? The listener still exist correct?So will remove the big on event puzzle out of the when loaded slot, and place them under the VehicleHighView puzzle?
well I will make a function and use it 4 times for each if loop
2023-06-26 at 3:04 pm #64856kdvParticipantJust place that puzzle somewhere separately. It doesn’t need to be inside some function. It’s an event listener for a specified HTML element, not an action.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-06-26 at 3:04 pm #64857Jeff BooneCustomerNow its works. Thanks men!
- This reply was modified 1 year, 5 months ago by Jeff Boone.
-
AuthorPosts
- You must be logged in to reply to this topic.