This commit is contained in:
Felipe M 2021-05-22 18:43:03 +02:00
parent 847670821d
commit c5a54977ac
Signed by: fmartingr
GPG key ID: 716BC147715E716F
7 changed files with 16 additions and 6 deletions

View file

@ -57,7 +57,17 @@ func assign_world_camera():
cameraFollow.remote_path = MainInstances.WorldCamera.get_path()
func _exit_tree():
MainInstances.Player = null
# We need to check if the player in maininstances is this player instance,
# it could be a loaded player and this call is made after the new player
# is instanced and set in the MainInstances, so the new player is there and
# we set it to null, breaking the game.
if MainInstances.Player == self:
MainInstances.Player = null
# This is another solution to the above problem
# func queue_free():
# MainInstances.Player = null
# .queue_free()
func _physics_process(delta):
just_jumped = false