Animated Character Jump (Unity Tutorial)

preview_player
Показать описание
In this Unity tutorial we're going to look at at how we can add an animated jump to a character.

We’ll look at how we can trigger animations when the character jumps, falls and lands.

The project files are available to our patrons here:

Want to follow along? This project is a good starting point

The final script can be found here

Help support our work:

Follow us:

Introduction - 0:00
Downloading the Assets from Mixamo - 0:41
Setting up the Animations - 2:55
Creating the Animation States and Transitions - 4:52
Setting the Animator Parameters from a Script - 9:29
Initial Testing of the Jump - 12:15
Fixing issue 1 - 12:40
Fixing issue 2 - 13:24
Summary - 15:09

#KetraGames #LearnUnity #UnityTutorials #UnityTips
Рекомендации по теме
Комментарии
Автор

Awesome tutorial clear and precise ! There's not that many tutorials about root-motion-based character-controller with jumping, you really helped me improving my system.
I subscribed without hesitation !

carljohnson
Автор

Thank you so much, especially for providing the final script! I forgot one line of code and being able to compare my script with yours was very useful.

picturize
Автор

You saved my life with fix 1, thank you

gabrieldejesusmunozramirez
Автор

i know its an "older" video but i just found out your channel and this series and i just want to say that you are so amazing, helped me so much to understand how several things are working in unity and helped me alot with my project, thank you so much and keep doing so good! happy new year by the way 🥳

Yuvalico
Автор

many thanks!! you are lifesaver. Looking forward for your next tutorial.

jatsparrow
Автор

Thank you for these videos, you are the best Ketra :)

tigerstriped
Автор

Awesome tutorial! Very easy and understandable. You can apply this to pretty much anything

swiftcreations
Автор

The Best video! youre the best to teach me Thanks u from colombia!

TechnologiesAdvanced
Автор

what if i am using direct blendtree ? means in my animator controller i added blendtree as default from entry in blendtree there are movement animation but in your case your by default is breathing state i don't know why can you help me ?

technicalm.t.b
Автор

Is there a video for how you might handle an animation that has the whole jump sequence? My friend and I are making a game together and she said video tutorials on making the jump animation all show the jump as one sequence and affect the transform on the y axis. I'm not sure how to make that work.

spirit
Автор

hi thank you for everything, i just have a problem now, after i updated my code to yours in this video for some reason i can't jump anymore. i'm not sure where i messed up but is there a typical issue when this happens? i've sort of been having issues jumping for a while, i'm not sure if my ground check thing works correctly. (i solved it, i still had a different ground check thing from a previous project in there for some reason lol)

torchilicho
Автор

These series are great! I have learned so much and very easy to follow. I have watched so many other tutorials on animations and I could never get them to work, but with yours I have been successful. One problem I have now thought is my character doesn't come out of the jumping up stage unless I hit space again, any ideas??
Keep up the great work and videos, they have all been very helpful to me!

dylanbrazier
Автор

Great video and series, I love your channel! One suggestion I would make to this down the road is for the animation when falling off something. One thing I noticed is that it will often times trigger the falling animation when falling off small slopes or obstacles, in my case I think I sloped the terrain a little steeper on my terrain path so when going from the higher grass field to the path, I was seeing numerous fall animations. This is caused by the check in the code on line 93 (from the video) where it checks for ySpeed < -2.

I actually updated my code to instead use a method that uses a physics raycast instead, this way you see the fall animation immediately when falling from something higher up and it prevents seeing it from smaller drops. I introduced a fallDistance unity field to the script that can be set in the inspector and then swapped the ySpeed <- 2 part from above with a method I created called CheckIfFalling(), the logic is below for anyone interested.

E.g. Snippet
private bool CheckIfFalling()
{
Ray ray = new Ray(transform.position, -transform.up);
//Debug.DrawRay(transform.position, -transform.up);
return (!Physics.Raycast(ray, out RaycastHit hit, fallDistance) && (ySpeed <= 0));
}

dondonnybtwenty
Автор

Hello Ketra Games, I have been watching your videos and I have been following along. I have made a project wherein I have a character which has idle, walking and running animations to it. I have been trying to add a 180 degree turnback animation such that when S is pressed the turnback animation should trigger and the character should walk in the backward direction. I tried almost everything but I can't get it to work properly. The character turns back with the animation but doesn't transition into the walking state and freezes in its pose. Can you please help with this?

abhaypasalkar
Автор

I have an issue where I jump and I land but my character is below its collider and phasing through the floor below. Its also stuck on an animation and I cant get it out

ura
Автор

Hello Ketra, amazing video for starters. I have watched all the way up until this point. This is a little silly, but I am having issues with the selecting of the three animations then selecting the player model for me. Doozy isn't showing up and I am not sure what to do.

missunknowngaming
Автор

Hi! Great video. It is working, however, when i changing between blend tree animation and the other, an error occurs (the error only appears on console, but everything is fine on gameplay) :
[Netcode] [DestinationState To Transition Info] Layer (0) does not exist!

Any tip?

ricardofigueiredo
Автор

Hi Ketra, really loving the Unity Tutorial videos! I have a question when I land from a jump I would like to be able to run immediately after the Landing animation there seems to be a slight pause?

hussein
Автор

Bit of a silly question cant seem to find the straight lines you've entered on my keyboard lol is there a way to sort this ? " || " Can find it on mobile phone
So I've had to copy that line of your script

bigbothoee
Автор

Great lessons! My question is, why does the jump interrupt the movement during the jump? I have set up animations in the same way so that they do not affect movement. But in the end, the animation of the jump resets the movement speed. I disabled the jump animation and the jump works fine.

MsWital