edited March 2014 in ORK Support
Ok, it's time for my daily question if you're not sick of me yet. :)

I was fooling with my Batman Versus the Martians 2D game last night, and I decided to try out the tutorial for the real time battle system. I set up the AI and got everything working. I especially like that it reports in a window what's happening: Player attack, AI attack whatnot.

So I got all that working. My question though is about animation, and I don't know if this is more of a Unity question or not. In order to use Unity 4.3 2d animations, do I use the mechanim setting in the framework, or do I do something different? I have to admit, I'm not so familiar with the new features of Unity 2D, though I do really like some of the aspects. Frankly, I'm just learning it and don't know how all the parameters work yet. My basic question is, how do I set up a GetInput trigger to activate an animation? Do I need to go into the Unity project settings and controls and set up a Fire1 or something for my attack?

Or would you advise using 2D Toolkit (which I already have) along with Playmaker, which I also have, to run the animations? I'm a little more familiar with those programs than Unity 2D. I know that Kirb is using 2D Toolkit for his game and has it working pretty seamlessly with Ork apparently.

I guess this might be more of a Unity question, but I was wondering if anyone had any thoughts.

Thanks for your time.
Matt
  • Yeah, I guess that's more of a Unity question ...

    Generally, if you want to perform actions through input, you can do this by using Control Maps. An example can be found in the later game tutorials about real time battles here.

    I haven't really tried the new 2D functionality yet myself, but if it's tied into Mecanim (and maybe even the old legacy system), you should have no problem getting the animations to work with ORK Framework.
    Regarding Mecanim, it kinda depends on your setup, e.g. you can either play the animations through setting parameters, or use the Play option to directly play them ...
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited March 2014
    I'm wrestling with this issue now using Unity's 2D tools. I haven't touched it in a few days, but I've been trying to decide my next move. You can set up Custom Animations in Ork (It'll be at the the bottom of the animations page, below Mecanim) that will call a Function in a script. I intend to try setting up a script with various functions for different animations, and having the function itself call the animations. You can also set up parameters in the Custom Animation, such as variables, that are required before the function will be called.

    Once you've set up a custom animation, you should be able to use it just like any other animation in Ork. Whether or not it will actually do what you want it to depends entirely upon how you code it....which is where I'm stuck at now.


    edit:

    There are a couple ways to call animations directly from a script in Unity. You can also set up a Blend Tree for 2D sprites for walk cycles, and probably a lot more, but that's as far as I've gotten with it.

    https://docs.unity3d.com/Documentation/ScriptReference/Animation.Play.html
    Post edited by atradeis13 on
  • If you're using the legacy animation system (don't know if this is possible with 2D?) or Mecanim, you can simply hook that up the same way as with 3D animations.

    E.g. the Animation.Play function is what's already used by the legacy animations in ORK Framework.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.