Hello,
so i recently started to create my first game with Godot. Today i stumbled across an issue that i would like to move out of my way. So here comes the explanation:
I have 2 functions that kill the player on contact. Those 2 functions go on 2 circular saws each.
func _on_Movable_Saw_1_body_entered(body):
if body.has_method("death"):
var player = get_parent().get_node("Player")
$Light2D.energy = 0
player.position = Vector2(0, 0)
player.death()
func _on_Movable_Saw_2_body_entered(body):
if body.has_method("death"):
var player = get_parent().get_node("Player")
$Light2D.energy = 0
player.position = Vector2(0, 0)
player.death()
I need to seperate them because when i duplicate the first circular saw the collision on the duplicated one wont work. Is there a way to just create one saw object that i can duplicate over and over again?