Early script.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Syl

Hello, I’ve made an animation player script keyed at 5 s in the animation track (animation triggered by a mouse click on the background), intended to change scene, yet it start as soon as my project. How’s that please?

In order to get help, you need to provide code, project or visual material.

Footurist | 2018-02-27 10:00

Sry, here’s the first scene.
Imgur: The magic of the Internet

My node2D script:
Imgur: The magic of the Internet

My animation script (wich I want to be triggered at the fifth sec):
Imgur: The magic of the Internet

See? (The animation dot at zero position is removed, but still the first scene is not loaded, directly the second.)

Syl | 2018-02-27 10:38

@Footurist I moved your answer to comment, because it’s not an answer.

volzhs | 2018-02-27 15:35

Ok, I solved it. Had simply to use node ‘animation_finished’ of the animationplayer.

Syl | 2018-02-27 16:19

Ok, I solved it. Had simply to use node ‘animation_finished’ of the animationplayer.:s

Syl | 2018-02-27 16:19

Ok, that’s great. But FYI, “animation finished” is a thing, that’s called a signal in Godot. Those come with every node and you can connect them to functions of your choice to use the provided arguments.

Footurist | 2018-02-27 16:25

Good to know, and really useful, thxs!

Syl | 2018-02-27 16:36

No problem, and btw you connect them either via the insepctor by double clicking on them (only possible for connecting nodes inside scene) or via script:

connect("pressed", self, "function_name", [arguments])

This way, you can also connect to remote nodes:

var target = get_node("../../../..")
connect("pressed", target, "function_name", [arguments])

Footurist | 2018-02-27 16:49

Good good, cheers!

Syl | 2018-02-27 16:58