From 2be0b42c14471a81836e07ed09bb069101b223b5 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 9 Jan 2023 00:35:59 +0100 Subject: [PATCH] Move player reference to @onready variable --- island/Seeds.gd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/island/Seeds.gd b/island/Seeds.gd index ef0a34f..5b9e7c8 100644 --- a/island/Seeds.gd +++ b/island/Seeds.gd @@ -3,7 +3,9 @@ extends RigidBody3D @export var value = 5 +@onready var player := Singletons.player + func _on_collectible_by_player_collected(): - var ps: PeaShooter = Singletons.player.get_node("Head/OnHand/PeaShooter") + var ps: PeaShooter = player.get_node("Head/OnHand/PeaShooter") ps.remaining += value