Please add the fix I mentioned here:
Just to be clear, this code has to be added where you handle button clicks.
Please add the fix I mentioned here:
Just to be clear, this code has to be added where you handle button clicks.
The inner timer triggers again right after the animation is done.
Cancelling the inner timer when clicking seems to fix the problem:
if action_id == hash("touch") and gui.pick_node(self.button3, action.x, action.y) and action.pressed then
gui.set_enabled(self.button3, false)
timer.cancel(self.timer_inner)
gui.set_enabled(self.text5, true)
end
Thanks! Iâm using set_visible to work around it. But thereâs probably a bug there that needs to be fixed.
Everything works as expected. Here is the sequence:
DEBUG:SCRIPT: 1774939808 outer repeating timer has triggered <=> start inner timer + enable button
DEBUG:SCRIPT: 1774939809 click and hide <=> disable button
DEBUG:SCRIPT: 1774939810 inner timer has triggered <=> start button animation (animation doesn`t start because button is disabled; animation remains "waiting")
DEBUG:SCRIPT: 1774939812 outer repeating timer has triggered <=> start inner timer + enable button("waiting" animation can finally start)
DEBUG:SCRIPT: 1774939814 inner animate done <=> the "waiting" animation finishes
DEBUG:SCRIPT: 1774939814 inner timer has triggered <=> start button animation
As it can be seen, the inner timer doesnât trigger right after the animation is done but it triggers right after the âwaitingâ animation is done. This âwaitingâ animation shouldnât exist, it should be explicitly canceled when the button is clicked(disabled).
The way to get rid of this âwaitingâ animation was mentioned here:
gui.set_enabled(self.button, false) gui.cancel_animations(self.button,"scale") gui.set_scale(self.button, vmath.vector3(1,1,1))
In conclusion, there is no bug.