- Edited
here is the code
public override void _UnhandledInput(InputEvent @event)
{
if (@event is InputEventMouseMotion)
{
Vector3 cam_rot = cam.Rotation.Clamp(new Vector3(-90, 0, 0), new Vector3(90, 0, 0));
InputEventMouseMotion eventa = @event as InputEventMouseMotion;
RotateY(-(eventa.Relative.X * 0.01f));
cam.RotateX(eventa.Relative.Y * 0.01f);
}
}
i need to find a way to clamp the rotation of the camera , ive used Math.clamp , didnt work , i have even used the clamp method inside the Rotation