Ive added a crouch function to the standard Template char, but when i try to add an animation for this in the Blend Tree i get stuck, ive tried to add a variable (Booloen) thats “ChrouchPressed”, with a transistion that is actrivate and one who arent, but i cant seem to activate the “Crouch” animation (My logic was using a button as trigger (buttonDown) but cant find anything usefull in the input secion), here is a picture of my experimenting:
Normally it works like that:
- add an event into your character blueprint - create a new bool variable (IsCrouching?) + change it to “editable” (in the details panel) - place two “set IsCrouching?” nodes into the event graph - connect them with the event - one of those set nodes should be on “true” and the other one on “false”
- now create a blendspace for the crouching animations -> just copy the walking/idle blendspace - delete all animations - change the speed value to a lower one - apply changes - add your crouching animations
- open the animation blueprint - add a “cast do mycharacter” node - drag out the blue link from it - search for “get IsCrouching?” and add the node
- create a new bool variable in the anim bp (IsCrouching?_Animbp) and add it to the graph
- connect the “get IsCrouching?” with the “set IsCrouching?_Animbp” + connect the “Is…_Animbp”
- now open the anim graph - add a new state - add a transition to the new state and back to the old state - add the “IsCrouching?_Animbp” variable to the transition from Idle/Run to the new state and a “not” + “Is…_Animbp” in the one from your new state the the old one
Also make sure to take a look at this tutorial: https://www.youtube.com/watch?v=Dtewkn8qIE0
Hmm i am not totaly understandin this step:
5. connect the “get IsCrouching?” with the “set IsCrouching?_Animbp” + connect the “Is…_Animbp”
Could you take a screenshot?
Yep, wait a sec, my UE is currently updating…
DUDE no need, it worked, mishmashed your video and your text, and it worked
Sorry double post, how do i keep my char crouched if theres a “roof” above him? the animation quits when i let go of the key, but if i do that under a block he stands up, the game “acts” like he still crouched, but the animation pops back to idle (i got a “Walk while crouch” funtion in my prototype, so he will stop alot under stuff)
Ok, then instead of using your own “crouch bool”, use the one which already exists -> search for “is crouched” and do the upper steps from 2. (you dont need the 1st step anymore)
Thanks alot, you realy helped out alot