In the Animator Controller I added a new state with animation the idea is to make a smooth transition between the idle to the new state animation.

The first transition is using in the conditions the parameter Throw I unchecked the Has Exit Time and in the code when I'm pressing the G key it's changing between the animations smooth nice enough.

Transition from idle to throw

The second transition is from the Throwing back to the Grounded(idle) also Has Exit Time unchecked and this time in the conditions I'm using the parameter Throw Back.

This time when I'm pressing the K key it's not changing smooth back to the idle but changing it at once like "jumping" to the idle.

transition from throw to idle

The code :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ThrowObject : MonoBehaviour
    public Animator animator;

    private void Start()

    void Update()
        if (Input.GetKeyDown(KeyCode.G))

        if (Input.GetKeyDown(KeyCode.K))
            animator.SetTrigger("Throw Back");

Why the second transition Throw Back is not working smoothly and just make a "jump" at once from the Throwing state to the Grounded(idle) state ?


You must log in to answer this question.

Browse other questions tagged .