My mouse delta isnt reseting its values, therefore the camera always continue to move in the last direction I moved.
Gamepad right stick works just fine, but mouse delta is causing me this weird behavior. It worked fine in version 1.0.2 but atfer upgrading to 1.3.0 it stopped working properly.
Same behavior in 1.2.0, 1.1.1
public class CL_BattleCamera : MonoBehaviour
{
[SerializeField] private float sensitivityX;
private float xRotation;
private Vector2 playerMovementInput;
private void Start()
{
Cursor.visible = false;
Cursor.lockState = CursorLockMode.Locked;
Application.targetFrameRate = 160;
}
public void InputLook(CallbackContext context)
{
playerMovementInput = context.ReadValue<Vector2>();
// this value doesnt reset
}
private void Update()
{
xRotation += playerMovementInput.y * sensitivityX;
xRotation = Mathf.Clamp(xRotation, -90f, 90f);
}
private void LateUpdate()
{
CalculateCamera();
}
private void CalculateCamera()
{
transform.localRotation = Quaternion.Euler(-xRotation, 0f, 0f);
}
}
This is probably solveable by polling the input in an Update methode, but this used to work in the previous versions so I think it’s a bug.