- Home /
How do I make a sidescrolling character work in both directions?
The character's in 3D and so far all the animations are set-up to the right (runs, slides, dashes etc.).
How do you usually set a character up so that everything will mirror when you move to the left....I'm using Unity's 'GetInput' to control the character, so I can't just rotate the character 180 degrees!
How is this usually done?
Many thanks in advance!!!
Answer by justinl · Sep 28, 2012 at 05:31 AM
This is usually done by setting up those animations and actions based on the character's forward vector (not relative to screen space). This way, if you rotate the character from right to left, the animations and behaviour will all still work. You would probably want 2 pairs of animations for each action because slides, for instance, might look weird if you're looking "from the back" and so depending on the direction of the input when calling the slide functionality, you'd want to call the appropriate facing animation.
I have no idea how you've set up your control, but having a velocity variable where positive values = movement to the right, and negative values = movement to the left would help tremendously.
Wow, thank-you so much Justin!!
This has clarified everything for me and now my character's moving in both directions without having to duplicate and mirror animations!!!
Thanks again! =D
Your answer
Follow this Question
Related Questions
Raycast Drection change problem 0 Answers
How to Rotate the Player In Direction of Movement? 4 Answers
how to fix the z position of an object 2 Answers
Help with my Character Controller 1 Answer
Flip 2D player in x-axis to face movement direction 5 Answers