Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
702 B
1
Indexable
Never
    public void Look(Vector2 lookAxis, float deltaTime)
    {
        if (canLookAway)
        {
            input = lookAxis;

            float deltaMouseX = -input.x * sensitivity * deltaTime;
            float deltaMouseY = -input.y * sensitivity * deltaTime;

            _playerInput.x += deltaMouseX;
            _playerInput.y += deltaMouseY;

            _playerInput.x = Mathf.Clamp(_playerInput.x, -90f, 90f);
            _playerInput.y = Mathf.Clamp(_playerInput.y, -90f, 90f);

            _charAnimData.deltaAimInput = new Vector2(deltaMouseX, deltaMouseY);

            Debug.Log(deltaMouseX);

            transform.Rotate(Vector3.up * deltaMouseX);
        }
    }
Leave a Comment