menus and settings
This commit is contained in:
@@ -16,15 +16,15 @@ public partial class HeadSystem : Node3D
|
||||
_camera = GetNode<Camera3D>("CameraSmooth/Camera3D");
|
||||
}
|
||||
|
||||
public void LookAround(Vector2 lookDir)
|
||||
public void LookAround(Vector2 lookDir, float sensitivitMultiplier = 1f)
|
||||
{
|
||||
// Horizontal movement of head
|
||||
float angleForHorizontalRotation = lookDir.X * LookSensitivity;
|
||||
float angleForHorizontalRotation = lookDir.X * LookSensitivity * sensitivitMultiplier;
|
||||
RotateY(angleForHorizontalRotation);
|
||||
|
||||
// Vertical movement of head
|
||||
Vector3 currentCameraRotation = _camera.Rotation;
|
||||
currentCameraRotation.X += Convert.ToSingle(lookDir.Y * LookSensitivity);
|
||||
currentCameraRotation.X += Convert.ToSingle(lookDir.Y * LookSensitivity * sensitivitMultiplier);
|
||||
currentCameraRotation.X = Mathf.Clamp(currentCameraRotation.X, Mathf.DegToRad(-90f), Mathf.DegToRad(90f));
|
||||
|
||||
_camera.Rotation = currentCameraRotation;
|
||||
|
||||
Reference in New Issue
Block a user