Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Huday.object |
I’m trying to connect my KineticBody2D to it’s CollisionShape2D child but whenever I run it, the debugger says:
Attempt to call function ‘connect’ in base ‘null instance’ on a null instance.
and I get the error:
Node not found: player
Here is my code:
extends CollisionShape2D
func _ready():
var player = get_parent()
$player.connect("phase", self, "_on_Player_phase")
func _on_Player_phase():
$CollisionShape2D.disabled = true