Replies: 1 comment 2 replies
-
In general there is a global method But Transform2D (and Transform3D too) also have a special method for interpolating - Example from documentation: var t = 0.0
func _physics_process(delta):
t += delta
$Monkey.transform = $Position1.transform.interpolate_with($Position2.transform, t) Also vectors (Vector2, Vector3) have a Example from documentation: const FOLLOW_SPEED = 4.0
func _physics_process(delta):
var mouse_pos = get_local_mouse_position()
$Sprite2D.position = $Sprite2D.position.lerp(mouse_pos, delta * FOLLOW_SPEED) Notice that in these examples the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to get the interpolated transform in 2D or is it exclusively for 3D spatials? I'm using physics interpolation in 2D and am trying to smooth out the camera.
Beta Was this translation helpful? Give feedback.
All reactions