I want to spawn characters with different skeletal meshes.

Hi,
I also want to call an array but didn’t understand how to use it.
I am using this code to spawn NPCs, but I want them to spawn with different skeletal meshes.

I suppose you could have the spawner dictate this, but I’d have a function in the NPC that randomly selects the Skeletal Mesh that the spawner would then call for each spawned NPC.

If the NPC always should have a randomized skeletal mesh, then I’d consider having the NPC call the function directly in its BeginPlay function, then the spawner just has to worry about spawning.

Here is an example of what that function would look like.

That’s great! Now how should I call this function in my spawner BP?

How are you actually spawning your NPCs in the world? I don’t see you are using the spawn actor node:

If you are using it, you can simply drag off of the return value (is a reference to the NPC actor that was spawned) and call the random mesh function you created in that blueprint class.

1 Like

It worked Thank You so much bro.

1 Like