- Home /
Making 3D character run left and right in a 2D environment.
Hi, I am making a game where visuals and environment are made in 3D,but where the player could only move in 2D (up, down, left right), much like a platform game.
However, I only managed to make my 3D character move to the right with a running animation with a key press of the right arrow button. My issue here is that I want my character to move towards the left using the same running animation i used for when it was running to the right with the left arrow button.
I am using the Mecanim plugin in Unity to do this, I hope someone could advise me on what I could do in my controller and script to make running left and right happen.
Solutions are much appreciated! Thanks!
Answer by dorpeleg · Aug 12, 2013 at 08:48 AM
It's simple, rotate the character back when pressing left.
For example:
If your character is moving left and right on the X axis, you need to rotate it on the Y axis when switching between directions.