Forum rules - please read before posting.

Animation problem.

I have a bug in the animation. In the video when I start the first test the animation works fine whether the player is on the ground walking or not.

The problem arises when I start the second test first I jump and then click on the list of actions to test and the animation does not work, it seems to be triggered so quickly that it becomes imperceptible. Can anyone help?

It only works if you're on the ground.

Comments

  • edited February 2023

    This problem seems to only occur in the animation ''Sprites Unity'' I switched to ''Sprites unity Complex'' and it worked perfectly

  • edited February 2023

    I've been studying the tutorial around here and applied the ''Sprites Unity Complex'' I'm triggering the animations well. My player jumps however without animation. I don't know how to use the jump animation that would be two animations, one for each side the character is on. Does anyone know the script or other command to call the animation when the player jumps?

  • As in, separate "jump left" and "jump right" animations?

    Sprite Unity Complex-based characters are animated through transitions based on Animator parameter values. Any parameter you assign in the NPC's Inspector will be automatically controlled by AC.

    For example, assigning an integer parameter in their Direction integer field will cause that parameter's value to be set to the direction they're facing, with 1 = left, 2 = right. You can then account for this in your Animator's transitions to play different jump animations based on this value.

    For full details on what parameter values are available for AC to control this way, see the Manual's "Character animation (Sprites Unity Complex)" chapter.

  • As in, separate "jump left" and "jump right" animations?

    yes, for the player. Something automatic that identifies which side the player is on, to trigger the correct animation.

  • I read the manual in that part about ''sprites unity complex''

    I didn't understand how to do it, I did it that way and it didn't work. The jump animation is not working.

  • edited February 2023

    Fields in the Player's "Mecanim parameters" box need to be set to the names of your Animator's parameters - not their intended values.

    Your parameter is named "Turn float" - this is what you'd need to enter into the Player's Inspector to have AC control it.

    However, the Turn float parameter relates to the speed that the character is turning. In this case, it's the Angle parameter, which you've entered into the "Body angle float" field, that's the one to use in your "Jump" Blend Tree.

    More importantly, though, you first need to get the Idle -> Jump transition working.

    First, create a new Bool parameter in your Animator named "IsJumping", and use this to trigger the transitions - i.e. when IsJumping = true, go from Idle -> Jump, and vice-versa.

    Then, attach this script (JumpAnim.cs) to your character:

    using UnityEngine;
    
    public class JumpAnim : MonoBehaviour
    {
    
        void Update ()
        {
            AC.Char character = GetComponent<AC.Char> ();
            character.GetAnimator ().SetBool ("IsJumping", character.IsJumping);
            character.GetAnimator ().SetBool ("IsGrounded", character.IsGrounded ());
        }
    
    }
    
  • edited February 2023

    I noticed a possible problem in unity, the version I use is 2020.1.0F 1 and the version of adventure creator 1.73.5. The problem is the animator that seems to suffer from some bug, note that the flow of animations in the animator does not appear and this I noticed a few days ago, this morning the animator window had worked showing the flow and without me making any changes it did not work more.

    This morning, when the animator showed the flow occurring in the ''base Layer'', the parameter bool isJumping also appeared, being activated when the player jumped.

    Regardless of this bug reported in the animator, the player when he is walking and jumps, the animation does not occur, he continues walking during the jump. If the player is stopped and jumps the animation occurs from the jump.

    Another bug in the animator is when I copy the ''brend tree'' from another existing one and click on it in the ''blend tree'' inspector, the inspector is blank.

    To not happen I have to create a new ''blend tree''

    I uninstalled and reinstalled Unity from the same version and the Problem persists.

    Up to which version of Unity from 2020 and above does the version of aventure creator 1.73.5 support, if I need to change the unity version?

  • AC supports the highest official release (currently 2022.2), though if there are issues with a beta release let me know.

    I'm not seeing any issue with Unity in your video, however. For the Animator window to update at runtime, you need to enable Auto Live Link in the top-right corner, and select the GameObject with the Animator in the Hierarchy.

    For the animation issue itself, it looks like it's a case of your Jump -> Idle transition being condition-based on your Jump bool, which becomes false once the jump begins.

    You can either remove this parameter condition from the transition, and use the "Exit Time" fields to have the transition only kick in once the jump animation has finished playing, or rely on a separate IsGrounded bool parameter that's set to True when the character is on the floor.

    I've updated the script above with the means to set this bool automatically in the same way.

  • I updated the script and made the changes but the problem remains the same. When the Player jumps in any direction, only the walking animation remains activated and does not deactivate to give way to the jump animation. Note that only jumping with the player in ''idle'' works

  • If you want Jump animations to play from the Walk state, you'll need to set up your Transitions to allow for it.

    You can do this by creating a new Transition from Walk -> Jump, and setting the conditions to match that of Idle -> Jump.

  • it worked, thanks again

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.