Godot V 4.1.2
Hello,
I’m a bit new to godot and I’m trying to make an evolution sim
when I run a pause I get this error : Cannot call method ‘create_timer’ on a null value.
func Pause(RNA, food):
#await(owner.ready)
await get_tree().create_timer(1).timeout
update_life(RNA, food)
if I uncomment the await(owner.ready) the code waits forever
If it’s needed here is the code that creates the child
func Make_Thing(DNA, food):
var thing_scene = preload("res://thing.tscn")
var thing2 = thing_scene.instantiate()
var setup = thing2.get_node("Sprite2D") # Adjust the path as per your scene hierarchy
DNA = [proteases, cellulase, thylakoids, move, fat, spike, shell, brain, MutationMod, SplitMod]
setup.initialize_life(DNA, food) # Call the setup_variables function
thing2.position = Vector2(randf_range(75, 1140), randf_range(10, 640))
add_child(thing2)