Godot Version
4.2
Question
As the title suggests my fps camera keeps going to its original rotation and stops me from looking around properly. I am trying to follow a tutorial where GDScript is being used and translate it to C#. I have no enough knowledge about programming to solve this to be honest and I must request your help. Here is the video of what is happening:
Here is the piece of code that takes care of the rotation of the camera:
public void _UpdateCamera(double delta)
{
mouse_rotation.X = tilt_input * (float)delta;
mouse_rotation.X = Mathf.Clamp(mouse_rotation.X, TILT_LOWER_LIMIT, TILT_UPPER_LIMIT);
mouse_rotation.Y = rotation_input * (float)delta;
Transform3D newTransform = CAMERA_CONTROLLER.Transform;
newTransform.Basis = Basis.FromEuler(mouse_rotation);
CAMERA_CONTROLLER.Transform = newTransform;
Vector3 newRotation = CAMERA_CONTROLLER.Rotation;
newRotation.Z = 0.0f;
CAMERA_CONTROLLER.Rotation = newRotation;
rotation_input = 0.0f;
tilt_input = 0.0f;
}
Any help is appreciated. Thank you in advance.