Search Unity

Simple Animation Transition

Discussion in 'Animation' started by EstevanStRuschel, Dec 10, 2013.

  1. EstevanStRuschel

    EstevanStRuschel

    Joined:
    Dec 10, 2013
    Posts:
    2
    Hi guys, i've got a problem in my project, i am importing a model from Blender in .fbx and with it 2 animations, im always playing the first animation (moving) and i want to play the second animation (jump) when space is pressed, the problem is when i press space the second animation dont start, it gets stuck on the last frame from the first animation, i should've used mecanim but now i dont want to lose another week of work, is there any solution?


    Thanks.


    Parts of my code below.

    void Update (){

    this.animation.Play("Running");

    if(Input.GetButton("Jump")){
    this.animation.Play("Jump");
    }
    }
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    It wouldn't take a week to switch to Mecanim — a day or so at most, I would think (and that's including an hour or two for you to go through the tutorial videos).

    But anyway my guess about the problem here is that you're playing the Running animation on every frame. I'm frankly surprised that works at all. :) Perhaps you meant to play Running in Startup(), and then do the input check and play Jump in Update?
     
  3. Ctls_Rajesh

    Ctls_Rajesh

    Joined:
    Dec 7, 2013
    Posts:
    10
    Sorry' i can't help this type of problem. You follow this website coding.smashingmagazine.com