But what I can’t find out… is how do I control the float values from a blueprint? How do I access WalkBlend and RunBlend from the Animation Blueprint?
The dog character I’m using is an actor blueprint in the scene. It has the dog’s skeletal mesh in the components, and in the animation tab the corresponding animation blueprint with walkBlend and runBlend float values. But I have no idea how to access those variables so I can blend between animations at runtime.
You need a Blend Space for that. Check out this(and probably the rest of that playlist) video: ?v=pfKdr0FRC5g&index=7&list=PLZlv_N0_O1gZS5HylO_368myr-Kg2ZLwb
I’ve tinkered with Blend Spaces and it’s very intuitive and versatile for blending many animations!
Regarding the tutorials, what the teacher does is retrieve the “Movement Component” from ‘Try Get Pawn Owner’ node, and from that, it gets movement values, and it feeds the “speed” and “is in air” values to the animation blend space and animation states.
What I want, actually, is to ultimately have a set of buttons, and trigger the corresponding animation for my character. For example one of the buttons is ‘dance’, and I want the character to dance when I click the button.
So right now I’m focusing on just being able to blend between animations, but I can’t “communicate” with the WalkBlend float and RunBlend float that I’ve created. I figured I could modify such float values from a class blueprint, but I don’t know how can I access the animation float values, that control blending.
I can actually Play an animation from a class blueprint, and snap between animations. What I can’t figure out, though, is blend between animations in a similar way.
Well, you access them using the Event Graph of your AnimBP. Set them there and they’ll change. You don’t actually access the blends/states, you just set variables like you would in any BP and the State Machine will change poses and states based on those values automatically.
The problem is FEEDING them; the AnimBP is designed to be fed by the capsule’s movement (i.e you move the capsule, that movement triggers the animation) and it’s not super intuitive getting it set up to respond directly to inputs or drive the capsule.
To do that you’ll need to either Cast or use an Interface so that you can use your character BP to trigger events or set variables in your animBP.
As RhythmScript said you create variables for those states and then get the input from the player BP just like you do with movement and set those variables with those events.
I had a little problem casting the bluepring because it was an Actor bluepring. I’ve tried with a pawn blueprint, and now I’m able to cast it from the Animation BP.