- Home /
How to do a sprite flip
In my project i have just a regular spriterenderer.flipX to flip the sprite but i would like to make it so that it does not feel so boring.
What i would like it to look like you can see from this video: https://youtu.be/g9U0KI8oEiA
Answer by rage_co · Aug 06, 2021 at 12:12 PM
The best solution according to me is that while turning, lerp the scale from +1 to -1 on the x axis...and when it's almost equal to that (use Mathf.Approximately).......put the scale back to +1 and turn on flip x, then repeat the process to flip it back...i would recommend placing the player sprite on a different object than what you control and then make it a child to the actual player so that it doesn't mess up the controls when scale turns negative...hope this helps
Oh thank you so much this worked perfectly!! The previous solutions in different questions i have seen have had some problems but this worked absolutely flawlessly!! Thank you!!!!!
Your answer
Follow this Question
Related Questions
Sprite flip movement script not working! HELP! 0 Answers
transform.position not doing anything 1 Answer
changing sprites depending on int value 1 Answer
2D spaceship rotation 0 Answers
Recoloring animated sprites [Solved] 2 Answers