How to instance a scene with diferent values from start

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Hiko
:warning: Old Version Published before Godot 3 was released.

Hi, maybe someone can help me with this, i have a scene where a random number is generated, this number is the time when an animation has to start, this start has to be random.

Works ok but, when i instance this scene (A) inside my main scene (B), and A is duplicated, the result, should be that all the A has a different start. But all the animations start at the same time.

  • B
    • A
    • A
    • A

How can i get each A start randomly at different time?

Thanks

:bust_in_silhouette: Reply From: GlaDOSik

I guess your random number script is somewhere in scene A. I would call function randomize() inside callback _enter_tree(). Every time the instance of scene A enters the tree, your seed should be reseted.

That worked, Thanks!

Hiko | 2016-07-05 13:01