Question by
Akravator · Jun 06, 2019 at 12:41 PM ·
c#animationanimationstransitiontransitions
Animation Transition Unity
Does anyone know how to transition a game object to an existing animation?
Currently I have a cube object like this:
The cube Object has a preconfigured simple jumping animation with fixed location as Layer default state. Lets call this animation: "BoxJumping".
The player however can move the cube object to any position(using wsad) key. When the player stop for 1 sec, I want the cube to transition back to the original position of the animation. Like this:
I can simply use:
private void playJumpAnim()
{
gameObject.GetComponent<Animation>().Play("BoxJumping");
}
However, it just directly move the cube to the preconfigure location which has been stored in the animation and play the animation without any smoothing transtion.
Does anyone know how to achieve this kind of transition?
Comment