Forum rules - please read before posting.

[SOLVED] [2D] Custom turning animation

edited April 2014 in Technical Q&A
Hi,

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!

Comments

  • 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.
  • Thanks for answering, Chris.

    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.
  • Following up on this, is the Sprites Unity Complex system able to service 2d toolkit sprites or is it just for native 2d sprites?
  • That sounds awesome Chris. Can't wait!
  • edited April 2014
    @domx: 'Fraid not - it's really just a way of manipulating Mecanim, not the sprites themselves.
  • Too bad :( I will try to resolve this script-wise then. Thanks for your help and pointers!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.