you havn’t hooked up the execution wire from the cast node to the set node so the code ends at the cast node.
also you’re better off creating a pawn variable and storing the pawn just once to the variable, then use the variable reference rather than getting the pawn every update. More efficient.
Debug object will be a dropdown. Select the only option in the dropdown (or one of the options if you have more than one fighter)
Look to see if the watch value is still ‘none’
I don’t ever trust the ‘watch value’ feature, maybe I should. Try using a ‘print string’ node after your cast node (not from ‘cast failed’). If the string appears on screen after hitting play, then pawn owner is valid, even if you can’t see it with watch value/debugger.
Could you explain how you did this in more detail? I’m having the same problem and am too new to know how to do what you said or what it even really means.
I believe what BPANDREW was saying about changing his “blueprint to be a character” has to do with the parent class of the blueprint. Every Blueprint ‘inherits’ or is a ‘child’ of another more abstract BP. Some of the general BP classes default in UE such as Actor and UserWidget are templates if you will. The Character BP class in particular is a child BP of Pawn which is more general. This is called inheritance when child classes can use general functionality of a parent class along with more additional functionality specific to that BP. For example, the Character BP by default has a SkeletalMesh component which allows you to animate characters and whatnot. Your AnimBP would return none when calling TryGetPawnOwner if the BP where you’re using the AnimBP does not inherit from Pawn. I can’t think of a way using blueprints to get a reference to the SkeletalMeshComponent if your BP just inherits from Actor instead of Pawn. You can reparent your actor BP to a Character BP in the class default settings of the blueprint.
I just wanted to add this for Posterity. The “TryGetPawnOwner” node only works if your skeletal mesh is implemented inside a Blueprint Pawn. This is fine if you’re using a blueprint pawn for your character, however, it will fail any time your actor is NOT a pawn. So, if you place a skeletal mesh in a scene directly and set it to use the AnimBP,(IE it’s not a Character Pawn blueprint with a skeletal mesh inside) then this will always fail.
So this alternative to using the “TryGetPawnOwner” node is to use the “GetOwningActor” instead. This node will ALWAYS succeed because it’s just getting whatever actor the skeletal mesh is implemented inside, and since any object you place in the world in Unreal Engine is derived from the Actor base class, then it will always work.