0 votes

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")
asked Dec 4, 2018 in Engine by whiteflag.tv (12 points)

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?

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.