Download

Pawn Owner is Third Person Character

Am trying to understand why when I run this blueprint from the animation blueprint the get pawn owner returned is the ThirdPersonCharacter when the character blueprint is XuFu_LC_Character_BP.

When I click play in the editor the print displays ThirdPersonCharacter (see 2nd image below) whereas when I have not clicked play it prints the correct Blueprint class.

I used the default ThirdPersonCharacter class to base my character from and then did a rename of the blueprinnt.

Its as though the rename has only partially updated things. Any ideas if this sounds correct, if so what else would I need to change?

Thanks.

Capture5.JPG

When I press play :

Capture3.JPG

When I have stopped the play test is displays the correct blueprint class.

Capture2.JPG

You’re printing before casting. You should probably cast right after Try Get Pawn Owner and save that as your reference/print that instead.

Hmm no i think the printing before the cast should work fine, have you tried restarting the engine? i have seen something like this before but i don’t recall it 100%.

I actually just checked, and what you are doing should work (according to my test).

I’m guessing the game mode wasn’t changed to use the new pawn then. Still you shouldn’t set a variable reference before casting.

Why not? If the variable is of type Pawn it shouldn’t matter.

This of course is totally up to the later use of the variable that you set.

This of course is totally up to the later use of the variable that you set.

In most cases it’s not very useful. If you set the reference to a generic BP like pawn you can’t get any specific stuff that’s in your actual BP, so every time you use the reference you will have to cast to your BP. Instead if you cast first and right click the As Your Bp and make that a reference you’ve got a reference that you can use without casting.

My point was that** if** your variable is a generic class e.g. Pawn, then there is no difference if you give it a Pawn or a MySpecificPawn, and there is no benefit to casting it to MySpecificPawn before setting the variable.

I don’t understand how you can debate this, it just depends on what properties you will try to get and set at a later stage from your reference.

On-topic, is your original problem solved?

Nevermind, we seem to be miscommunicating. I am not the OP by the way.