Download

Get skeletal mesh from actor class?

Hey there,

I’m attempting to create an enemy spawner that will preview the skeletal mesh of the enemy I want to spawn based on an actor class variable. Is there a way to get the skeletal mesh from my actor class?

You are referencing a Skeleton Class change the Variable to Skeleton Mesh Object Reference that should work.

Hmmm, my enemy is an actor class yeah, but it needs to be a class to spawn the actor, and I don’t want to set the variable twice.

Maybe IU’m just going about this the wrong way? My goal is to have one spawner blueprint that I can use for all enemies in the game, and to just set a single variable which would select the correct enemy blueprint, and visualize them within the editor.

You can set the enemy var to an array, then from your enemy character make children of it. Now back on enemy var make editable. Drag off enemy and use GET(Copy),from the GET integer drag and type in random integer in range. Now drag off enemy again and get LENGTH and plug LENGTH into MAX on random INT in Range. This spawns a different enemy with in the arrays length.


I made a custom event ran by timer as seen SPAWNAI, the transform is just random points in Navigational Area (You need a Nav Mesh in Level)

Here is the timer I set and promoted Time and Loop to a Variable and made editable as well.
Timer.png

With these as variables we can set each spawn point to act different, some you may want to spawn once so uncheck (SpawnTimer?) Or you may want different times for spawn checks for different enemies so we can just change (SpawnRate).

Once you put the BP in world you will control over all these Vars and functions so we can now add enemies to our BP by ticking the + on Enemy Array Var from there you can choose what type of enemies you want to spawn.

Hope I helped not the best at explaining.