So I am very new to game development and coding in general. I am trying to write code and make stuff myself, but immediately I stumbled on this problem
It’s test flappy bird game, right now I’m trying to spawn pipes on timer, but it spawns only one pipe and then does nothing
var pipes_scene = preload ("res://pipes.tscn")
var can_add_pipes:bool = true
func _process(delta):
pass
if can_add_pipes:
var pipes = pipes_scene.instantiate()
add_child(pipes)
$pipes.position.x = $pipespawn.position.x
can_add_pipes = false
$pipes.position.x -= 100 * delta
func _on_timer_timeout(delta):
pass
can_add_pipes = true
I’ve searched for an answer, but found only godot v3 forums and guides
upd: I am stupid, but I’ve found out that bool in can_add_pipes simply doesn’t change. It works when I export it to inspector and manually turning it on and off
I also forgot to start timer.
Now I need to know how to change bool
upd2: I am VERY stupid. It appears that it wants to spawn same pipes over and over. It doesn’t want to make new pipes. Now I have NO idea what in the world am I doing
pls help