Godot Version
v4.3.stable.official [77dcf97d8]
Question
I wanted to teleport the player up seamlessly but it's buggy and looks bad
v4.3.stable.official [77dcf97d8]
I wanted to teleport the player up seamlessly but it's buggy and looks bad
what about setting the position directly?
$Player.global_position = Vector2(-100, -500)
What does the scene tree look like? Is there a camera node? If so, where is it?
The camera is part of the player
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
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
Is this scene, in which you are trying to call this, inside the scene_tree?
You have to create the tween inside the method. you cant store it
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
Sorry i ment to say EASEING instead of seeing