If if create a child class for a character and then change the mesh in the child class, the updated mesh should show up when using this child class right? if not, how would you do so?

It should and it does:

307275-annotation-2020-07-15-203630.jpg

So the question is: how are you doing it?

If if create a child class for a character and then change the mesh in the child class, the updated mesh should show up when using this child class right? if not, how would you do so?

So i also changed the mesh in the child class and it shows up there like in the picture you posted. But when i try to change the default pawn class to one of these classes based on the if statement i have, it doesn’t actually change the default pawn class when i press play and just loads up the original default pawn class that i have set. (i hope this makes sense)

The original question wasn’t specific enough i think, and this is what i am stuck on.

the actor gets destroyed but the new one isn’t showing up and i get a blueprint run time error.

Blueprint Runtime Error: “Attempted to access Pedestrian_Child_C_0 via property Pedestrian, but Pedestrian_Child_C_0 is pending kill”. Blueprint: MyPlayerController Function: Execute Ubergraph My Player Controller Graph: EventGraph Node: Add Movement Input

the actor gets destroyed but the new one isn’t showing up and i get a blueprint run time error.

Blueprint Runtime Error: “Attempted to access Pedestrian_Child_C_0 via property Pedestrian, but Pedestrian_Child_C_0 is pending kill”. Blueprint: MyPlayerController Function: Execute Ubergraph My Player Controller Graph: EventGraph Node: Add Movement Input

Maybe Spawn actor refuses to spawn it seeing how the location is 0,0,0 which may place it in the solid geometry. Can you do isValid after the spawn?

Yeah, I’d just ensure there is enough space - add a couple of hundred Z just in case; the script looks about right. You can override collision handling on spawn node - there should be an Always Spawn option.

Ah, I see. It’s a matter of order of execution. The Game Mode will create its default pawn. Once it has been created you change the class. But the pawn has been already created at this point.

That’s the whole point of having a default Pawn, I guess. You should be able to destroy the default Pawn (or set it to None) and spawn a new / desired one:

Not sure if there’s a better way of doing it.

It will work with character since it inherits from Pawn, yes. Nodes are context sensitive: Get Player Controller first → drag a wire, search for Posses and then hook up the Pawn.

If you look at the pic above, you’ll notice that Possess needs Controller as the target - that’s its context sensitivity in this very instance.

Alternatively, you can uncheck Context Sensitive in the upper right of the All Actions for this Blueprint window. Not recommended in the long run, but sometimes it might be useful if you can’t figure out which node belongs to which class.

Hm, not sure what’s the context for that.

The player controller is trying to move the pawn that was destroyed.

Destroyed actors are not really removed from memory immediately but rather flagged for destruction. At some point the Garbage Collection system scoops them up but these actors are inaccessible during that time.

How similar is your setup to the one I posted?

It’s pretty much identical besides the logic i have before it. Pedestrian is the default pawn class i have set originally, and then pedestrian child is what i want to get if isMale(a boolean) is true.

Technically this should work, actually.

oh cool, it was a problem with the spawn location, as soon as i changed the z value to be above the platform that i am on, it worked ( since 0,0,0 was in between the floor)

is there a way now to make the character spawn at the place where the player start node is located instead of at the spawn transform location?

is there a way now to make the
character spawn at the place where the
player start node is located instead
of at the spawn transform location?

OK, so I had a proper look at how the Game Mode handles Pawns and Player Start and here’s what I believe is the proper way to do it. While spawning & possessing definitely works fine, the game mode has some exposed functionality to simplify this:

  • if you set the Default Pawn for this GameMode, you will need to destroy that pawn first
  • there’s no need to possess since Restart Player will do it automagically while picking up the Player Start location, too

When it comes to Player Start itself, it comes with a built in tag system:

In this case I supplied MyStart42 as an ID and it can be used like so:

So you could easily have male / female Player Starts and use that. If the provided name is invalid, Player Start will be chosen at random, which can be desired at times.


There are other method for doing all this but I believe that’s the intended way. It may not be suitable to all game genres but if the goal is to have characters frolic around the map, I’d handle it like above.

for the incoming name in the find player start node, is there a way i can get a variable there since I have multiple levels that I select from before actually start the game

Figured it out, there’s a variable called get options string that you can use!