So I’m having trouble with my Animation Blueprint for one of my AI-driven characters. It turns out, the AI works great, but the Animation Blueprint does not.
I’ve tried a Print String node on every branch of that sequence here, and found that it is not receiving Exec from Update Animation, due to the Character Reference not being Valid.
My State Machine is in perfect working order, there are no bad rules in it.
What could possibly be making my character invalid? Interesting fact, after plugging in a print string to the success and fail Execs on my casting, it seems that the casting only works 50% of the time as well.
Your character variable is invalid because you are not setting it anywhere. It’s a nullptr until you pass in a value to set it.
During “Event Blueprint Initialize Animation” where you have get owner casting to a character node then you should get the out pin an pass that to set the character variable.
If you character variable is of a specific blueprint implementation then get owner and cast to the variable type and then set it.
Does the mesh component “Mesh” have it’s anim instance set to the ABP_…V2 anim instance type blueprint?
Is it of type skeletal mesh component? (Only those can have anim instances if I remember correctly)
You could also push this function to a place when you need the variable. Then check if it’s valid, if not then go through the init process that you now have at begin play.
Apparently, because it is an AIController controlling the Character Blueprint, the normal Movement Input scripts do not apply. How do I get into those AI movements? Should I get into those?
Check some tutorials about AI. It’s a rather broad subject. It would take a lot of explaining but there are a lot of resources out there that will explain it better and faster than I can.