![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | malkav182 |
I’m trying to make a points counter label. Every time a block is hit, it should add value to the label text. This node emits a signal to another scene, the game scene.
signal pts(qt)
...
func hit(damage , node):
health -= damage
emit_signal("pts" , damage)
The complication is that the block scene is instanced on the game scene.
onready var pre_brick = preload("res://scenes/block.tscn")
...
var bricks = null
...
var brick = pre_brick.instance()
bricks = brick
I’m trying to connect to the signal like this, but I don’ think it is working.
bricks.connect("pts" , self , "on_pts")
How do I connect to an instanced object signal?