I have set my variable to public,but I don’t know what to connect to the “cast to third person character” node to eliminate the error.
Try Get Pawn Owner
then cast that within your Animation BP.
thank you, it works now.
Best way to do this in 2020/2021 is to NOT do any of that.
in character blueprint, take the main scheletal mesh into the graph, drag off it and type cast to “name of animation blueprint”.
off the blue pin, drag off and promote to variable.
Hook it up to the unlabeled entry pin from the cast.
hook this whole sequence up to “on begin play”. if you get issues add a short delay before it, set a boolean and disable tick event things from running unless that boolean has been triggered.
after the reference is set, you can drag off it and set whatever variable is within the animation blueprint, which is really all you should have to do.
update the ABP variables externally this way, directly from the character instead of running code to determine things within the animation blueprint itself.
When possible, this allows the usage of the animation fast path.
note that it isn’t always possible, or always needed…
Also note that you could create functions within the animation blueprint to process logic and that should be fine, however it may be preferable to just creare events on the character so they could potentially be called externally.