system
1
|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
rodadas |
hi,
i have an instance not in the scene and a label in the scene
and i want to increment the score when it spwans
on_time_timeout()
var pipe =preload(“res://pipe.tscn”).instance
add_child(pipe)
pipe.connect(“pipe”, label,“plusscore”)
and in the label i
func plusscore()
system
2
|
|
|
|
Reply From: |
MintSoda |
Your code is broken. Use code sample button for your code.
You wrote pipe.connect("pipe", label,"plusscore")
pipe doesn’t sound like a signal name to me. If pipe is a signal, did you declare/emit it?
pipe.gd which attached to pipe.tscn
extends Node
signal pipe
Every time you pipe.emit_signal("pipe")
, plus_score()
is called.
Also, why don’t you just label.plus_score()
?