Forum rules - please read before posting.

Sprite Unity Jump Animation and Ledge Climb

So I actually have two questions?

  1. How do I assign a custom jump animation as currently the player jumps but its just the walking or running animation.

  2. I would like to make it so that for a player can is prompted climb over objects, the animation play and the character move to the new position. I have tried a couple of methods with no success.

I can get an animation to play and the player teleports but I cannot get it so the camera follows smoothly. Move to a point doesn't work as that requires player input to complete the path. I have also tried rigging a custom camera to follow the player with little success.

Any help is greatly appreciated

Comments

  • How do I assign a custom jump animation as currently the player jumps but its just the walking or running animation.

    Sprites Unity doesn't support jumping - are you using a custom script, or placing the character in a 3D scene (i.e. he has a 3D Rigidbody)?

    You could concievably include an "Is jumping" boolean parameter in your character's Animator component, and control it through script, i.e.:

    private void Update ()
    {
        GetComponent <Animator>().SetBool ("IsJumping", AC.KickStarter.player.isJumping);
    }
    

    However, for that to have an effect you'd need to switch to Sprites Unity Complex, which relies on Animator parameters for animation playback.

    I would like to make it so that for a player can is prompted climb over objects, the animation play and the character move to the new position

    To be clear, the issue is with the camera?

    What you could try is teleporting the player first, and changing the climbing animation so that it ends in the final position, rather than is starting from the start position.

    This would cause the current camera that's following the player to go to this final position, and you could then use an interim camera to handle the transition:

    1. Create a second camera with no movement options
    2. Teleport this camera to the normal gameplay camera using Object: Teleport (attach a Marker to the gameplay camera)
    3. Snap to the second camera using Camera: Switch with zero transition time
    4. Teleport the player / animate him
    5. Change to the gameplay camera using Camera: Switch with transition time
  • Using sprites Unity at the moment but will move over to complex now that I know that is possible and yes 2D sprites with a 3D rigidbody.

    I'll switch over and apply the script and see how far I get

    My issue is I cannot get it too look "Smooth". Move along path is generally the right thing the camera stays on the player but from it requires the player to push character. Teleporting the player also works but the camera snaps and I need it be smooth.

    I tested that method you suggested and it seemed to work but I need to keep testing it. Is this the way you would go about performing this event?

  • edited January 2019

    Is this the way you would go about performing this event?

    That would be the first thing I'd try, yes. You can also use Timeline, since AC now has a MainCamera Timeline track.

  • Yes I will do that, thank you for you're help

  • Hey Chris so all you're suggestions worked a treat and things are performing well. Is there a Grounded Bool for Sprites Unity Complex? I have noticed there is an option for one inside the mechanim but not the for Complex Sprite System. Currently the animation plays but doesn't transition back sometimes as it doesn't know if its grounded.

  • Never mind used the Vertical Float as the ground check

  • Is there a Grounded Bool for Sprites Unity Complex?

    Not directly, but you can attach a simple script to update a boolean Animator parameter named "IsGrounded" based off the character's script directly:

    private void Update ()
    {
        bool isGrounded = GetComponent <Char>().IsGrounded ();
        GetComponent <Animator>().SetBool ("IsGrounded", isGrounded);
    }
    
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.