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.
14 lines
324 B
14 lines
324 B
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)); |
|
} |
|
}
|
|
|