a game about throwing hammers made for the github game off
Diffstat (limited to 'player/player.gd')
| -rw-r--r-- | player/player.gd | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/player/player.gd b/player/player.gd index 27126c6..9d45ec1 100644 --- a/player/player.gd +++ b/player/player.gd @@ -157,7 +157,7 @@ func hammer_highlight() -> void: hamms[0].highlight() func hammer_pickup() -> void: - if Input.is_action_just_pressed("pickup") and last_highlit and not current_hammer: + if Input.is_action_just_pressed("pickup") and is_instance_valid(last_highlit) and not current_hammer: last_highlit.unhighlight() current_hammer = last_highlit Globals.levelmanager.current_level.remove_child(current_hammer) |