U
U
Uncle Bogdan2021-09-02 18:15:51
Unity
Uncle Bogdan, 2021-09-02 18:15:51

Why is the player turning in z?

I don't add in z, but it rotates in z. What's the catch?

private void MouseMove()
    {
        Vector2 mousevelosity = new Vector2(Input.GetAxisRaw("Mouse X"), Input.GetAxisRaw("Mouse Y")) * _sensitivity;

        _currentMouseSmooth = Vector2.SmoothDamp(_currentMouseSmooth, mousevelosity, ref _mouseVelosity, _mouseSmooth);

        transform.Rotate(_currentMouseSmooth.x, _currentMouseSmooth.y, 0);
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pashara, 2021-09-02
@pashara

Rotation around the Z-axis to the Euler angle value of 0. Everything works as written in the code. You don't add 0, you turn to 0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question