Godot Version
4.5
Question
I want each instanced scene to activate at different time. The scene is a node3D parent that will activate a child laser beam scene using a timer
parent node3D
-laser_beam_child scene
parent.gd
@onready var laser_beam_raycast3d = $Laser_Beam_RayCast3D
@export var activation_time : float
func _ready() → void:
await get_tree().create_timer(activation_time).timeout
laser_beam_raycast3d.activated()
Child’s activated() is a tween
func activated():
print(“SDFSDFSD”)
visible = true
tween = get_tree().create_tween().set_loops()
tween.tween_callback(collision_activated)
tween.tween_property(beam_mesh.mesh, “top_radius”, beam_radius, time)
tween.parallel().tween_property(beam_mesh.mesh, “bottom_radius”, beam_radius, time)
tween.tween_interval(2)
tween.tween_property(beam_mesh.mesh, “top_radius”, 0.0, time)
tween.parallel().tween_property(beam_mesh.mesh, “bottom_radius”, 0.0, time)
tween.tween_callback(collision_deactivated)
tween.tween_interval(2)
Then I add multiple parent instances to a world scene and try to change @export “activation_time” for each of those instances.
world
- parent_1 # activate_time = 1.0
- parent_2 # activate_time = 5.0
One instance would work fine but another would messed up. The Tweens visually would activated at the same time plus collisions would be out of sync. Why wouldn’t this set up work?