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.


# 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("Player 1: respawned")
in Engine by (12 points)

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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.