Search Unity

Firing Bullet using Playmaker - Animation gets weird

Discussion in 'Animation' started by nluckett, Oct 14, 2014.

  1. nluckett

    nluckett

    Joined:
    Jul 30, 2014
    Posts:
    14
    Hi guys, so I have a character that is able to walk, run, jump etc (I used Character Controller Pro to get the basics setup). Now I want to add an attack. I decided to add a throw motion and have him throw a ball/bullet that will kill things.

    I have the ball working. I can throw it every time I click the mouse button and it comes out of the spawner and does what it is supposed to do.

    However, I can only figure out how to get the animation of the guy throwing the ball to play once. It plays once (using the Animator Play function) and then wont play every time I press the button. Somehow it's not getting in the loop.

    And then the other problem is that I can't figure out how to release myself from the Throw state and go back to idle.

    I am attaching a pic showing my PlayMaker setup. I am a newbie at coding, so Ive been using Playmaker.

    You will see that I added a new state in the Animator called "Throw". Inside that is my throw animation "p1_throw" with 3 sprites in it. PlayMaker calls the Throw State from the Animator, but then gets stuck somewhere.

    Any help would be appreciated!
     

    Attached Files:

  2. TD10074405

    TD10074405

    Joined:
    Aug 23, 2014
    Posts:
    35
    It doesn't appear you have any of your animation states linked, you need to send and return to a state to actually get it to return IIRC

    We've only used the mechanim system rather than the legacy system for this project we're working on. But each state is returned by a flow-system using boolean values!

    Gimme' a second and I'll load up UFree on my other machine and take a look for you
     
  3. TD10074405

    TD10074405

    Joined:
    Aug 23, 2014
    Posts:
    35

    Whilst not the best representation of a mechanim system, this was our early tester before we added blend trees to compensate for the crouching motion too

    If you right click on one (in our case Idle) it will say something like "Add Transition" drag this arrow it makes to the next animation you want (doesn't have to be in any order). Then on that animation (in our case Forward) right-click and again add transition, drag this to idle and it will have a to and return from idle to forward. This can then have values added by clicking on the "arrows" of each state.

    I will do a quick series of images in a second.
     
  4. TD10074405

    TD10074405

    Joined:
    Aug 23, 2014
    Posts:
    35
    http://imgur.com/a/9zDFg This should take you to an album with a basic system of how to create a transition, you need to add conditions to your states i.e boolean values
     
  5. nluckett

    nluckett

    Joined:
    Jul 30, 2014
    Posts:
    14
    Ohhh, right. Let me try this. The Character Controller that I have is from the asset store and the guy has it setup so that you dont have to make those transitions. They are made through his own scripting. But you might be right that any new actions I add I will need to hook them up. Thanks, gonna give this a shot when I get home.