Player spawn
This commit is contained in:
@@ -36,13 +36,14 @@ public partial class TestCharacter : CharacterBody3D
|
||||
if (direction != Vector3.Zero)
|
||||
{
|
||||
velocity.X = direction.X * _speed;
|
||||
velocity.Z = direction.Z * _speed * 2;
|
||||
velocity.Z = direction.Z * _speed;
|
||||
GetNode<Node3D>("Pivot").LookAt(Position + direction, Vector3.Forward + Vector3.Up);
|
||||
GetNode<Node3D>("CollisionShape3D").LookAt(Position + direction, Vector3.Forward + Vector3.Up);
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.X = Mathf.MoveToward(Velocity.X, 0, _speed);
|
||||
velocity.Z = Mathf.MoveToward(Velocity.Z, 0, _speed * 2);
|
||||
velocity.Z = Mathf.MoveToward(Velocity.Z, 0, _speed);
|
||||
}
|
||||
return velocity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user