Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | whiteflag.tv |
I’m trying to move a node using global_position after being teleported using the same idea, but it doesn’t teleport it back to where I specified.
Code:
# Destroying if not Visible Anymore
if player1VisibilityRef.get_ref():
if !player1Visibility.is_on_screen() && player1IsDead == false:
player1.global_position.x = -1000
player1.global_position.y = -1000
player1IsDead = true
func on_timeout_complete():
print("Timeout: finished")
player1IsDead = false
deadTimeoutEnded = true
didTimeoutOnce = false
player1.global_position.x = player2.global_position.x
player1.global_position.y = player2.global_position.y
print(player1.global_position.x)
print(player1.global_position.y)
print(player2.global_position.x)
print(player2.global_position.y)
print("Player 1: respawned")
Hi,
I don’t understand which of the global_positions is not working. The one that sets it to -1000,-1000 or the one that sets player1 to player2 position? Could i see complete code?
p7f | 2018-12-04 17:59