Best way to teleport a player seemlessly

Godot Version

v4.3.stable.official [77dcf97d8]

Question

I wanted to teleport the player up seamlessly but it's buggy and looks bad

1 Like

what about setting the position directly?

$Player.global_position = Vector2(-100, -500)
5 Likes

What does the scene tree look like? Is there a camera node? If so, where is it?

1 Like

The camera is part of the player

The player scene

The level-one scene

I’m trying to make the player teleport up so that when they fall off the level it looks like they fall onto the level again

image

Have you tried this?

I did but it still look like teleporting instead of falling

So you want to glide him back and not teleport?
You can use tweens for that:

var target_position = Vector2(-100, -500)
var time = 1.0
var tween = get_tree().create_tween()
tween.set_ease(Tween.EASE_OUT)
tween.set_trans(Tween.TRANS_EXPO)
tween.tween_property(body, "global_position", target_position, time)

you can even animate the speed with ease and trans settings of the tween.
Heres a cheatsheet of the easing-methods:

:)) Have you tried to teleport everything down? :))

I thought of doing that but then if the player kept falling it would keep going down and it might be bad if its very far down

I got a error,

Is this scene, in which you are trying to call this, inside the scene_tree?

what is a scene tree?
Would this help?

You have to create the tween inside the method. you cant store it

Like this?

It still looks like teleporting because of the camera, is there a way to fully lock the camera to the player and turn off the camera esaseing? the camera is part of the player’s scene
image

The main problem is the camera, here is an image of the way I want it to look

Sorry i ment to say EASEING instead of seeing