What is good practice for making something actor, pawn, character etc.?

@Etyuhibosecyu Sorry for the confusion. I know casts have a common misconception of what they are used for. I am not saying “Because they are slow”, what I’m saying is that casts are not useful for checking if one actor is another actor, or another common misconception, that they are for communication. I was guilty of that one myself for months when I first began using Unreal.

During that time, I thought of a cast like casting a fishing pole and reeling it in.
This is wrong.
It is more akin to a mold that a smith would use to CAST a sword, or a CAST for when you have a broken bone.

Anything that the cast target CAN cast to will trigger the collision. This could provide issues.
An “Is Child Of” node means anything below the listed class in the hierarchy will work, but nothing above that will. Yes, it’s slightly slower than a cast, but will cause less issue IF you only want children of that class to trigger it and not any parents.

If you just want it to be “Ally”, use a == class node. That is 100% faster than a cast.

Yup! You replace any of the actors you put in the world with their corresponding spawner. If you need better visual representation, you can give the spawner a static mesh that has “Visible” set to true, and “Hidden in game” set to true as well, so you can see it in the editor, but not in game.

So, moving on, now you have a spawner. You can create a child of that spawner, then in Class Defaults, set the actorToSpawn variable to the class you need. Example:

BP_Spawner_Rabbit
would have the class set to “BP_Rabbit”.

You can make a different spawner for every type of NPC you want, then just drop them in for virtually 0 cost. You could even get fancy and add randomization to it later.

This will lower your overhead IMMENSELY.

1 Like