# 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?

**URL:** <https://forums.unrealengine.com/t/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/468213>\
**Category:** C++\
**Tags:** child-class, unreal-engine, question\
**Created:** [July 15, 2020, 6:09pm UTC](https://forums.unrealengine.com/t/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/468213 "2020-07-15T18:09:09Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![donkeykongy323](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@donkeykongy323](https://forums.unrealengine.com/u/donkeykongy323)\
**Post date:** [July 15, 2020, 6:09pm UTC](https://forums.unrealengine.com/t/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/468213/1 "2020-07-15T18:09:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [July 15, 2020, 7:36pm UTC](https://forums.unrealengine.com/t/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/468213/2 "2020-07-15T19:36:53Z")

</div>

It should and it does:

![307275-annotation-2020-07-15-203630.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/f/8/8f8b93516f7175c06a4fb2c6b23e3b4584fbf93d.jpeg)

So the question is: _how_ are _you_ doing it?

---

<div class="post-metadata">

**Author:** ![donkeykongy323](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@donkeykongy323](https://forums.unrealengine.com/u/donkeykongy323)\
**Post date:** [July 15, 2020, 7:49pm UTC](https://forums.unrealengine.com/t/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/468213/3 "2020-07-15T19:49:01Z")

</div>

![307282-set-pawn-class.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/f/a/6faf93b2a9751c6a566e8a10d4e0718b765e0bc7.png)

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)

---

<div class="post-metadata">

**Author:** ![donkeykongy323](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@donkeykongy323](https://forums.unrealengine.com/u/donkeykongy323)\
**Post date:** [July 15, 2020, 7:51pm UTC](https://forums.unrealengine.com/t/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/468213/4 "2020-07-15T19:51:27Z")

</div>

![307284-e.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/1/3/b13ea836fa1a553b97958f299d476402531ad707.png)

---

<div class="post-metadata">

**Author:** ![donkeykongy323](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@donkeykongy323](https://forums.unrealengine.com/u/donkeykongy323)\
**Post date:** [July 15, 2020, 7:53pm UTC](https://forums.unrealengine.com/t/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/468213/5 "2020-07-15T19:53:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [July 15, 2020, 8:16pm UTC](https://forums.unrealengine.com/t/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/468213/6 "2020-07-15T20:16:25Z")

</div>

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:

 ![307276-annotation-2020-07-15-211541.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/d/12dc9a556469595aeed3da1dd32e4b236606bf21.jpeg)

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

---

<div class="post-metadata">

**Author:** ![donkeykongy323](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@donkeykongy323](https://forums.unrealengine.com/u/donkeykongy323)\
**Post date:** [July 15, 2020, 8:27pm UTC](https://forums.unrealengine.com/t/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/468213/7 "2020-07-15T20:27:31Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [July 15, 2020, 8:35pm UTC](https://forums.unrealengine.com/t/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/468213/8 "2020-07-15T20:35:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [July 15, 2020, 8:37pm UTC](https://forums.unrealengine.com/t/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/468213/9 "2020-07-15T20:37:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![donkeykongy323](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@donkeykongy323](https://forums.unrealengine.com/u/donkeykongy323)\
**Post date:** [July 15, 2020, 8:41pm UTC](https://forums.unrealengine.com/t/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/468213/10 "2020-07-15T20:41:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [July 15, 2020, 8:50pm UTC](https://forums.unrealengine.com/t/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/468213/11 "2020-07-15T20:50:19Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![donkeykongy323](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@donkeykongy323](https://forums.unrealengine.com/u/donkeykongy323)\
**Post date:** [July 15, 2020, 8:57pm UTC](https://forums.unrealengine.com/t/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/468213/12 "2020-07-15T20:57:02Z")

</div>

![307285-possess.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/2/6e2008344db1c2ec011ea3c21357214b2fe86a1d.png)

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.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [July 15, 2020, 9:02pm UTC](https://forums.unrealengine.com/t/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/468213/13 "2020-07-15T21:02:58Z")

</div>

Technically this should work, actually.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [July 15, 2020, 9:05pm UTC](https://forums.unrealengine.com/t/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/468213/14 "2020-07-15T21:05:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![donkeykongy323](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@donkeykongy323](https://forums.unrealengine.com/u/donkeykongy323)\
**Post date:** [July 15, 2020, 11:38pm UTC](https://forums.unrealengine.com/t/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/468213/15 "2020-07-15T23:38:36Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![donkeykongy323](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@donkeykongy323](https://forums.unrealengine.com/u/donkeykongy323)\
**Post date:** [July 15, 2020, 11:39pm UTC](https://forums.unrealengine.com/t/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/468213/16 "2020-07-15T23:39:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [July 16, 2020, 7:26am UTC](https://forums.unrealengine.com/t/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/468213/17 "2020-07-16T07:26:05Z")

</div>

> 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:

 ![307298-gamdemode.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/7/c/47c2eec1d4ceac5cb8fc6713a3a05a43d7289e4d.jpeg)

- 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:

 ![307299-player-start.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/3/4/2345912bcd05dffecde47fe54141aa811907f049.jpeg)

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

 ![307300-playerstart.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/9/2895bc6a1d927653b2bf8cab8a7eb6b7ce188df8.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![donkeykongy323](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@donkeykongy323](https://forums.unrealengine.com/u/donkeykongy323)\
**Post date:** [July 16, 2020, 3:34pm UTC](https://forums.unrealengine.com/t/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/468213/18 "2020-07-16T15:34:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![donkeykongy323](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@donkeykongy323](https://forums.unrealengine.com/u/donkeykongy323)\
**Post date:** [July 16, 2020, 3:36pm UTC](https://forums.unrealengine.com/t/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/468213/19 "2020-07-16T15:36:50Z")

</div>

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