Help with Side Scroller Run Backward Animation (need to transform the run animation)

Hello,

I am doing a side scroll game for my Coursework and I got a favour or a question.

I am using the “Unity 4.0 - Mecanim Animation Tutorial” with the provided animations and scrip. The thing I currently got is a run forward animation and walk backwards.

1202669--48293--$foreward.jpg

1202669--48294--$backwards.jpg

I would like to have the run forward animation being transformed into run backwards. So when I am running right it is using the run forward animation, and at the same time when I am running left it is going to use the run forward animation but transformed 180 degrees on the vertical axis. So it would look something like this:

1202669--48293--$foreward.jpg

1202669--48299--$left.jpg

If someone would provide me with simple solution that will be compatible with the script or the animation stage.
Is there any simple few lines of code that would transform the run right animation into run left?

Kind Regards,
Lukasz K.

In the image it looks like you got it going in the opposite direction as you stated. I would think just rotating the character 180 degrees should work.

unfortunately if will not work. I have allready tried it. When I did this the animations basically switched places.

It’s always best to have dummy when animating characters in my opinion. Parent it to an empty GameObject. Rotate and Translate (or however you do it) the GameObject and animate the actual model/character. So the animation can occur on the character but rotate the parent GameObject 180 degrees.

It did not work as well, Still used the walk back animation and did not transform the model. Just to remind I am using the “Unity 4.0 - Mecanim Animation Tutorial” and their script and animations, and it is litle bit hard for me to understand everything as I am using the Unity for first time…

I use 3.4.2 and tried upgrading to 4.0. It seemed very difficult and had some malfunctions. You can download previous versions going back very far.

EDIT: “Malfunctions”, I may have been causing them somehow but I ended up making my own editor script to set parameters for sphere and capsule colliders because it stopped letting me change the values at a point.

could you tell me what is the code for rotation because i am doing side scroller and when i press “D” it goes runs to left but when i press “A” it runs backwards, how can i make the character look were hes running