This is actually works in the editor/ viewport when playing, but it causing some errors. The first is a warning saying:
Node Blend Poses (Weapons_Enum) uses potentially thread-unsafe call Get Player Character . Disable threaded update or use a thread-safe call. Function may need BlueprintThreadSafe metadata adding.
and the next error appears when I stop running my game saying:
Blueprint Runtime Error: "Accessed None trying to read property K2Node_DynamicCast_AsBP_First_Person_Character". Node: Blend Poses (Weapons_Enum) Graph: AnimGraph Function: Execute Ubergraph First Person Anim BP Blueprint: FirstPerson_AnimBP
second one is just saying that the reference to the character is empty. A simple is valid node will save you there.
If the character should be valid at some point but its not, that’s a whole issue that you got to dig into the details of your code to figure out. But anytime you are casting or using some actor reference like that, it’s always good to use an is valid check and make sure you plug a print string into the “failed” exec pin and leave a note for yourself in the future.
You can check the output log during PIE (play in editor) and it will tell you the blueprint and function/event where a log was called from. That will help you figure out when some references are failing and you can work backwards from there.
Thanks for the reply. 2 things. The thread-unsafe warning was me trying to get the enum from the character instead of the character setting the enum in the animation blueprint. So I created a weapon enum variable in the animation blueprint to set. But it doesn’t seem to be working / cant set it.
And for your suggestion of checking if the animation pose is valid, I’m not sure how I would do that. I can’t find a node to interact with a pose properly.
ok turns out I can’t set it because the mesh I’m accessing is empty. The mesh 1P has my actual character in it, but I get this error when trying to access it.
BoilerplateCharacter.Mesh1P is not blueprint visible (BlueprintReadOnly or BlueprintReadWrite). Please fix mark up or cease accessing as this will be made an error in a future release. Get Mesh1P
Created a variable in the animation blueprint, changed it from within the character blueprint
To fix the is not blueprint visible, I duplicated the mesh and it allowed me to use it. I then went into the inherited class and deleted the code that created the original mesh component so I wouldn’t have 2 redundant meshes.
After fixing these problems I no longer had to find a way to validate if the poses were empty, they just sorted themselves out.