What I'm trying to do:
I have a global variable ( WorldTime.time ), increasing in value by "1", after every "Time Out", of a timer. THIS WORKS. I have my code set up so if my "time" variable is BETWEEN 15 and 17, AND if another global variable requirement is met, then the animation player will play my animation. the animation itself is only 3 SECONDS LONG, so if it starts when time is 17, then it would end at 20.

I want my animation to start between 15 - 17 ( depending on when the currentScene variable changes). I want it to play at a normal speed, and end at it's normal time, without rushing.

what it does:
My dialog loads extremely fast!!!! instead of starting at any whole number between 15 & 17, it starts at 15 and ends at 17. I want it to load slower or by button click??

note:
My game is set to end when "time" == 20.

My code that controls when this animation is played:

func _on_Timer_timeout():
	if WorldTime.time >= 15 && WorldTime.time <= 17:
		if SceneChanger.currentScene == SceneChanger.Quai_Branly:
			SUB_GM_DialogBox.beginDialogFunction()
			play("DE_SQB_EK-FR_1_15-17_20_X")
		else:
			print_debug("DE_cutscene_cordinator: Dialog not valid/found_")

P.S. if you want to see the code for my actual dialog, I can provide it. My dialog is loaded from a .JSON, so the code is long and annoying, so I didn't want to post it if I didn't have to. Thanks!!!!

  • If your timer times out after one second, that means the function will be true for 2 or 3 times and the animation will get played more than once. So you need a bool or something to stop it if the animation is already playing. Maybe you don't have a one second timer, but if you do that would be a problem.

If your timer times out after one second, that means the function will be true for 2 or 3 times and the animation will get played more than once. So you need a bool or something to stop it if the animation is already playing. Maybe you don't have a one second timer, but if you do that would be a problem.

    fire7side
    I will try to implement this idea, THANK YOU!!!!

    Do you think If I did something like:

    If "animation".is_playing == true:
    yield()

    That might stop the animation from playing multiple times?

      BeeTheLeaf12 I would not use a yield there because you don't always know if they are still running or not. You can just add an

      if "animation".is_playing != true:
      play("animation")