menus and settings
This commit is contained in:
@@ -21,6 +21,7 @@ public partial class Bobbing: Node3D
|
||||
public float Delta;
|
||||
public bool IsOnFloorCustom;
|
||||
public Vector3 Velocity;
|
||||
public float SettingsMultiplier;
|
||||
}
|
||||
|
||||
private float _bobbingAccumulator; // Constantly increases when player moves in X or/and Z axis
|
||||
@@ -38,8 +39,8 @@ public partial class Bobbing: Node3D
|
||||
// Because both of them are just waves, we will be slide up with y and then slide down with y
|
||||
// creating bobbing effect. The same works for cos. As the _bobbingAccumulator increases the cos decreases and then increases
|
||||
|
||||
newPositionForCamera.Y = Mathf.Sin(_bobbingAccumulator * BobbingFrequency) * BobbingAmplitude;
|
||||
newPositionForCamera.X = Mathf.Cos(_bobbingAccumulator * BobbingFrequency / 2.0f) * BobbingAmplitude;
|
||||
newPositionForCamera.Y = Mathf.Sin(_bobbingAccumulator * BobbingFrequency) * BobbingAmplitude * parameters.SettingsMultiplier;
|
||||
newPositionForCamera.X = Mathf.Cos(_bobbingAccumulator * BobbingFrequency / 2.0f) * BobbingAmplitude * parameters.SettingsMultiplier;
|
||||
|
||||
_camera.Position = newPositionForCamera;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user