I'm following the flappy bird tutorial again to tune my skills some more. I'm on Tutorial 3. Spawning. On the spawner_pipe.gd I have the following and the line:
new_pipe.set_pos(get_pos())
is giving the following error:
Invalid call. Nonexistent function 'get_pos' in base 'Node (spawner_pipe.gd)'.
When I type set_pos()
I get auto complete happening but when I type get_pos()
I get no auto complete. Strange.
Here is the full code so far:
#script: spawner_pipe
extends Node
const scn_pipe = preload("res://scenes/pipe.tscn")
func _ready():
spawn_pipe()
pass
func spawn_pipe():
var new_pipe = scn_pipe.instance()
new_pipe.set_pos(get_pos())
get_node("container").add_child(new_pipe)
pass
func go_next_pos():
pass