I created an input in the project settings for “Use” for “E” button. would be used to interact with doors, handles etc. I made an animation for it. Now i want to get working with my character blueprint and animation blueprint. I set up the state machine, now I need to give value to the “Is Pressed?” boolean that controls the transition.
So how can I make it work in the character animation blueprint graph, then in the character blueprint graph?
Hi Croatoan,
I am including an image to help with explanation. Also I am doing from a basic first-person blueprint project.
As you stated, the first thing you will want to do is set up a bool variable for “Is Using?”
Then in the Anim Blueprint’s Event Graph, drag from “Try Get Pawn Owner” Return Value pin and create a Cast To MyCharacter node. Connect that into the execution after “Is Valid”, then drag from “As My Character C” and search for “Is Using”. With that “Is Using” node, you can pass that variable’s information to your Anim BP. So create a Bool variable in your Anim BP (Call it “Is Using” also) and set it from the Is Using from the character.
&d=1407254236
Next, go into your Anim Graph’s State machine. You will need to set up a Using state. Connect that to Idle or whichever state you transition to “Using” from. Open the State, create a Play node for your Animation and connect it to the result.
Go back to the State Machine graph and double-click the Transition from Idle to Using, then get your “Is Using” variable and connect it into “Result Can Enter Transition”. What does now is the Anim BP gets the Is Using from the Character, sets its own Is Using based on the Character’s, then tells the State that it can change to “Using”.
&d=1407252579
Lastly, connect the Using state back to idle and open the new Transition. Here we will define when the character has finished using. Right-click, get a Time Remaining node for the animation and connect that to a Less than node. will let you check to see if the animation is almost done, then change back to the idle.
Let me know if helps of if you have any other questions.
Hi , thank you very much for your help.
I created the “Is using?” in the state machine for the transition, and the state machine is working well.
But I dont know where/how to make the first bool variable for “is using?”. So the “Cast to Character Blueprint, as Character Blueprint C” node doesn’t find the “is using”. (The missing node in the print screen)
Do you have the bool variable “Is Using?” in “CharacteBP”? The image with “Input Action Use” is in the Character Blueprint that the animation is attached to (In your case CharacteBP). In your first post’s second image you can see your Input Action Use is in the same place I set mine up.
Let me know if that helps.
Yeah, sorry I forgot to create the boolean there .oops . Thank you for your help now it works perfectly!