TryGetPawnOwner always returning None, why?

Hi there,

I’ve already searched the forums/answer hub for something on this and what I found didn’t seem to apply to me, so here goes.

I’m working on an anim instance for a character in my game, and I need his speed to set his blend properly. However, no matter what I try, TryGetPawnOwner always returns none even when I do, in fact, have a pawn owner. I’m attaching screenshots to show that I have an owner and what it’s doing, and I’d appreciate any insight or small thing I’m probably overlooking.

Thanks!

41815-animowned.png

“TryGetPawnOwner” is a function specifically designed to be used with Animation instances. So, if you want to use it on your Animation instance, you have to wire it up to an Animation instance. If you drag your Animation instance into the graph, then you can connect it to the “Target” pin for “TryGetPawnOwner.”

I do want those, yes, but I’m using an animation instance, so I have to use TryGetPawnowner.

sorry, just saw that and corrected my answer :slight_smile:

I’m having the same prolem. Don’t know much about animations but am trying it out now. I’ve set up my new skeletal Mesh with its animation blueprint and basically copied over from the thirdperson Anim blueprint. Now my new animation blueprint fires off when I play but it always returns “none” on my trygetpawnowner owner. Even get player pwan - 0 returns none. Please help :slight_smile:

Make sure Cast to “Name” is correct. Note that “Cast to Character” and “Cast to MyCharacter” are entirely different. I am working with pawn owner and it works all the time. So maybe the Casting is the problem.

I tried to cast it to every level of the character hierarchy to see if it was something with that, and it wasn’t. The screen shot above was just my last attempt. It has never worked for me under any circumstances, and I’m 100% sure it is an owned animation instance. I’m probably doing something wrong somewhere, but I’d like to know what.

Okay let’s try it from very beginning.

  1. Create an Actor BP, and call it Test_BP
  2. Add a scene component, then a skeletal mesh component.
  3. Set your skeletal mesh and its anim_bp in that BP you created
  4. Open up your Anim_BP and use “Try get pawn owner” and “Cast to Test_BP”
  5. Place that actor on the level and you just created and see if the casting is still failing.
  6. To get the correct result, while simulating the game, get into your AnimGraph BP and from top side chose the actor from the list to debug.
  7. Optional - Show me all the screenshots. Including the BP you created, the animBP’s event graph etc.

See if those works.

Is your characterBP actually called “Character”? You’ll need to cast to the actual name of the characterBP that is using this animBP. So if your characterBP is named DudeBro420BlazeIt, you’d use a Cast to DudeBro420BlazeIt node.

If it really is just called “Character”, then:

Is your character or characters that are actually using this animBP in the world?

If so, do you have the AnimBP assigned to their skeletal mesh in the characterBP? If you’re not sure, go to your characterBP, click the skeletal mesh component, find the Animation section in the Details panel, set Animation Mode to Use Animation Blueprint, and set Anim Blueprint Generated Class to your animBP.

This problem should only arise if the animBP you are debugging has no actual in-world reference to cast to, or if you are casting to the wrong BP class.

I have a similar issue - for me it seems that I get “none” object references and the correct object alternating, see my screenshot below:

Do you haven an idea how this could happen?

I have my Character hooked up to the correct Animation blueprint:

My Animation blueprint looks like this:

OK, I figured out my last question on the alternating outcomes for the “TryGetPawnOwner” - when you have the editor of the Animation blueprint open in the background, it seems to still receive input somehow, but it does not get a valid object reference. This is what causes the alternations in the cast-ok and cast-failed outputs.

See the screen below, now it works correctly. So my screenshots above could possibly serve as an help to set it up correctly.

1 Like

[I am having exactly the same problem.
I did all the steps you listed above.
If I create the same blueprints in a Blank project it works perfectly but in
my current project it fails ever time. The pawn is always = none.

Ive seen many posts on the same exact problem and no fixes,
Is this a bug ?

Im trying to get a grasp on UE4 but this sort of problem is a killer.

Hello smokeBONES,
I had the same issue as you ( or at least I thought so) with receiving always none-Pawns in the TryGetPawnOwner function. In my version (4.7.6) it seemed to be an issue when I had the AnimationBlueprint tab open during gameplay, that I received both correct pawns (not none) and none-Pawns, alternating. As if the tab in the editor also was somehow active. I am pretty sure you checked this (running the game while not having your AnimationBlueprint tab open), but I just wanted to let you know from my experience, because this caused me some real headache, also during debugging the blueprint.

Cheers,

1 Like

Thank you :slight_smile:
You right !! Close the animBP window, and … it s working. (issue for dual screen, and that why tutorial on youtube works everytime)

Other way, on top label icon (from animBP), there are 2 icons. “Preview” or “Ref Pose”. Switch with Ref Pos, before run the engine, resolve the conflict.

RIght! Same here, if animBP is open on another Screen, I receive ok/failed alternately.
If the animBP is closed, I receive ok and the Pawn variables are readable.

I have had exactly the same problem with the blueprint animation. In my case it was that I had created a new blueprint animation and assigned a blueprint skeleton. Apparently, it still retains the reference to the old. I had to remove the blueprint from the scene and re-add it. Apparently it will be updated correct

I had this same problem, and for me the problem turned out that I had the wrong skeletal mesh selected, as in not the same one as in my Animation. When I imported the skeletal mesh, it also created a named_skeletonGroup36960 and a named_skeletonGroup36960_PhysicsAsset.
I had chosen the Group one instead of my actual asset.

This kills the skeletal linkage so it can’t use the animation.

I tried to get this working where the SkelMesh was nested in the pawn’s MotionController componenrt (for Oculus Rift Touch) component. This would seem logical because then the mesh just follows the controller around directly. But from there the cast to anim instance always fails.
Instead, I made the Skelmesh in a new actor and made this actor a Child Actor directly under the pawn’s scene root, and Attached the child actor to the motioncontroller component at beginplay. Now I can directly cast into the skeletal mesh’s anim instance just fine.

This problem seems a bad limitation and I don’t understand it really; I’m just glad I found a work around.

By the way, you don’t have to use Try Gret Pawn Owner.
If you can cast from Pawn into the anim instance you can set a Pawn variable there (make sure to convert it to validated get) and use get a reference to self in the pawn blueprint and pass it in.