You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
324 B
15 lines
324 B
2 months ago
|
public partial class CameraController : Node3D
|
||
|
{
|
||
|
private Vector3 Offset;
|
||
|
public override void _Ready()
|
||
|
{
|
||
|
Offset = Position;
|
||
|
}
|
||
|
|
||
|
public override void _Process(double delta)
|
||
|
{
|
||
|
var target = GetParent<Node3D>().GlobalPosition + Offset;
|
||
|
GlobalPosition = GlobalPosition.Lerp(target, 1 - Pow(0.05f, (float)delta));
|
||
|
}
|
||
|
}
|