How to add another animation clip to Unity Starter Assets Third Person Controller? You tell me how..

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys habib here in this video i'm going to show you how to add our custom animation to our character when we are using this unity third person starter asset right now we already have this working animation idle animation jumping animation and running animation what if we want to add another animation such as dying or another animation so here let's let me show you how let me stop the game it is mixamo here i'm going to add one of those dyeing animation to our to my game let me check what if i what if i hide this one not bad let me download it click download button just without skin choose without skin and i will download it here on my computer download yeah let me close the mix ammo we have this zombie dying fbx file all right let's go back to this unity we have this zombie dying fbx file it has animation clip here and [Music] i'm going to show you where is the animation controller of this unity third person starter asset package it is here inside starter assets third person controller and no sims playground no character animations yes it is here it is here the animation control what we are going to do is to add another animation which is dying animation dying let me check where is the script that controls the animations i think it is [Music] hang on second maybe this one edit script [Music] okay i think it is the script that controls the animation you have this function assign animation ids [Music] jump freefall motion speed grounded speed and let's check for example jam animation what is jam in this animation controller animator animation controller [Music] okay we have this parameters here speed jump grounded free fall motion speed and if you check these arrows this one is idle animation and this is an arrow for an arrow pointing to the jumpstart and it has this condition jump true and let's accept time m t okay so what [Music] what we are going to do is to add another animation state here right click on empty space add empty [Music] here we type another i will call it dying yeah dying and for this one double click it [Music] double click and here click this little icon choose the zombie dyeing what which one is that mixamo.com this one zombietime.fbi usually it needs to be [Music] set look no just forget it [Music] we have this dying stitch here and let's add an arrow from either either walk around plant from here [Music] and for this one the arrow make it same as this one without exit time okay without exit time and then for the condition we will add new condition [Music] let's add new condition here boolean condition dying and here we click this plus button choose [Music] now this one is done the animator or animation controller for the animation controller we are done with it and here let's go back to the script we need to edit this part i'm going to duplicate this line and i will rename this and anim id [Music] okay let's name it anime id diane animator string to hashtag [Music] okay okay the condition that we made here should be safe dying and here should be time does not exist does not exist in the current context okay let's check how we can add this new nmid thingy let me copy this variable name [Music] here animation ids private and we will duplicate it and rename it this way i name id diagram okay it starts to make noise again all right [Music] we have this anime id dying here and let's go checking out you can see this line any metal dot set float or this one animator dot set pool and name id jump files this line is controlling the animation controller it tells the animation controller to stop jump and free fall animation setbull falls it is telling it to stop the animation if you set it true it will start or play the animation so what i'm going to do is to use let me copy this one and [Music] on the update function let me find the update here i will add a condition i will add a condition yeah let's make changes to the original clip i will add i don't know it should it be public or private let's see private [Music] let's say we added here [Music] my next [Music] i will type public bull [Music] is dead [Music] fox now in the update function [Music] here i will add if statement if there if step is false [Music] please do these three functions run this three function else [Music] dying [Music] okay and depression control [Music] the next thing is how to access this script from [Music] do we have untrigger entrance tracker exit here we don't have let me add on trigger enter thingy here [Music] should i add it [Music] yeah i should add it below this bracket here i will add one three girl and then [Music] killer [Music] and here i will set the value of is dead to true [Music] did you get it i'm just experimenting and i don't know will it work or not but it worked to try let's go back to unit editor what is it the name id dying does not exist in the current content [Music] forget it and here i'm going to add another cube to the object cube that oh what did i do yeah i'll name it that area i will move it here and i use it as a trigger i apply a tag the attack should be player now let's test it [Music] click the play button and i'm going to go inside this trigger that area and let me see am i going to die there one two three are you ready here we go okay i'm falling down but it's strange it did not play the dying animation let me check [Music] the capsule where is the capsule player capsule player armature [Music] all right ah i'm not so sure what is happening right now but [Music] the the dying state is playing right now but why is it stuck this way i don't know [Music] okay do you have any idea has accepted time it doesn't have exist exit time let me change that one on update function here what if what if i hmm [Music] [Music] still have no idea still have no idea i this step is first now let's [Music] forget about the triangle the trigger let me just click this checkbox [Music] okay oh [Music] the animator [Music] should i add another arrow or transition but how from this transition [Music] [Music] three [Music] hmm [Music] what happened [Music] step [Music] i think these animations they needs need something and it doesn't have right now it has this arrow to tie in and that one what should i add here make transition should i add a transition to in air like this one jump start has exit time let me just try have a transition to impair and this one has exit time this one should also have exit time okay let me try to play it again what will happen is let's go to the dead area it's still the same all right all right let me find out how to solve it let me delete this transition and i think this if statement makes problem what if i cut them this way and i change it if it's dead i will set the animation to this i name id diane and just forget about this [Music] but [Music] let me go back and test it [Music] i'm going to place it side by side so i can see which part of the animation state is running [Music] okay it is idle work run and a little lock run panel let's go here it is moving so what what i did previously was correct but i don't know why the dying animation is not playing correctly [Music] all right i'm stuck here 22 minutes of recording i think i will stop the recording and i will do some workarounds and some problem solving i will let you know what is the correct way of doing it [Music] this character is funny looks like he is walking on a floating area floated area okay thank you for watching see you next time on the night on my next videos bye bye
Info
Channel: ThirteeNov Coding Vlog
Views: 11,301
Rating: undefined out of 5
Keywords:
Id: ZHnQWLEX8z4
Channel Id: undefined
Length: 23min 3sec (1383 seconds)
Published: Mon Jul 25 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.