I am currently working on 2D with 2D Toolkit and I am trying to use a custom turn animation (the character only walks along one axis). Is this supported in any way with the current version of AC? Thanks!
I reckon you'd have an easier time getting around this using Unity Sprites as your animation engine, since you can make use of Mecanim variables. A custom script could work out the sprite's direction, relative position to the mouse etc., and control a parameter used to play either a TurnLeft or TurnRight animation.
Then again, if you're turn animation was only 3 frames long, you could always try splitting them into the Walk_DR, Walk_D and Walk_DL clips.
True, Mecanim would offer an instant solution, but for a numer of reasons I am using 2D Toolkit (which is quite ironic, because back in November/December I asked you about native 2D support for AC).
I'll try to play around with existing clips, but if this will not suffice, I guess I will experiment with injecting an additional turning clip.
One extra question Chris - can you suggest if turning (ie. for 2D changing the played directional animation or mirroring R or L anim) is handled per animation system or somewhere in generic, shared code base related to navigation? I started digging, but you might save me a lot of time if you drop a file name or a similar tip. Cheers!
The 2D direction is handled in the Char script - look for the GetSpriteDirection and SetSpriteDirection functions.
However, you may prefer to wait for 1.29 - which will feature a new animation engine called "Sprites Unity Complex". It works much like the Mecanim implementation - if you give it a move speed parameter, and a direction parameter, it'll update both on the fly, allowing you to implement your own custom FSM as you see fit. This way, you could have a custom animation play from Idle_L to Walk_R, for example.
Comments
Then again, if you're turn animation was only 3 frames long, you could always try splitting them into the Walk_DR, Walk_D and Walk_DL clips.
However, you may prefer to wait for 1.29 - which will feature a new animation engine called "Sprites Unity Complex". It works much like the Mecanim implementation - if you give it a move speed parameter, and a direction parameter, it'll update both on the fly, allowing you to implement your own custom FSM as you see fit. This way, you could have a custom animation play from Idle_L to Walk_R, for example.