Forum begins after the advertisement:

 


[Part 8] Fixing sprite flipping issues

Home Forums Video Game Tutorial Series Creating a Metroidvania in Unity [Part 8] Fixing sprite flipping issues

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #18171
    Terence
    Level 31
    Keymaster
    Helpful?
    Up
    0
    ::

    @RafaelSantos posts this on YouTube:

    I was getting issues with flipping on wall jumping and i saw that on the code some time we fliped with localscale -1 : 1, and other with eulerAngles 0 : 180, so i change the flip() for eulerAngles instead of localscale.
    void Flip()
    {
        if (xAxis > 0 && !pState.lookingRight)
        {
            Turn();
        }
        else if (xAxis < 0 && pState.lookingRight)
        {
            Turn();
        }
    }
    void Turn()
    {
        pState.lookingRight = !pState.lookingRight;
        float yRotation = pState.lookingRight ? 0 : 180;
        transform.eulerAngles = new Vector3(0, yRotation, 0);
    }

    and with this it work perfectly,better than before, but i need to do some ajustments on bias, i saw a very good videos about camera movements of hollow knight, and if you can create new chapter like, upgrading camera movement, it will be awsome: the video of the camera: https://www.youtube.com/watch?v=9dzBrLUIF8g

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: