Combination of flipX and Quaternion.Euler

Is there any reason why on the FlipDown and FlipUp animation events, we can’t transform in the y using the Quaternion.Euler as well, since we’re already doing manipulation of the transform. I.e…

    public void SwingUpFlipAnim()
    {
        if (_playerController.FaceDirection == FaceDirection.Left)
        {
            slashAnim.gameObject.transform.rotation = Quaternion.Euler(-180, -180, 0);
        }
        else
        {
            slashAnim.gameObject.transform.rotation = Quaternion.Euler(-180, 0, 0);
        }
    }

    public void SwingDownFlipAnim()
    {
        if (_playerController.FaceDirection == FaceDirection.Left)
        {
            slashAnim.gameObject.transform.rotation = Quaternion.Euler(0, -180, 0);
        }
        else
        {
            slashAnim.gameObject.transform.rotation = Quaternion.Euler(0, 0, 0);
        }
    }

You absolutely can. There are often many paths to the same goal.

Privacy & Terms