How to cast to a blueprint with multiple spawns

HI, i have a blueprint ‘Enemy’ which has several spawns in my game deriving from the same blueprint. i want to access the variables of specific spawns and use them in another blueprint. i cant find what i need to plug into the Object wildcard in the cast node.


you need to have a reference to the actor you looking to change. what exactly are you trying to change and from where? your question says your trying to change the spawns but the script you show says you want to modify the enemy.

i have an enemy that when attacking spawns a projectile from the ‘EnemyArrow’ actor blueprint. Inside this blueprint i want to find out which enemy spawned the projectile and get a variable from that spawn.

if thats the case i would create a variable in the projectile actor named something like “whospawnedme?” then make the variable exposed on spawn in the details panel. then in the enemy bp when he goes to spawn the arrow set the variable. this way the arrow will always have a reference to who spawned it.

its in a similar fashion to this post

sorry, im not that advanced in ue4, what kind of variable? what is exposed on spawn?

the variable type would be something like actor, character, or the class of your enemy. what expose on spawn does is it allows you to set the variable when the actor is created, so it basically sets the initial value. another thing is it adds a pin to nodes like the spawn actor of class node for the variable as seen in the pictures in the post i linked. below ill link a video about expose on spawn.

A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums11-_Expose_on_Spawn

Ok, this worked great. thank you very much :slight_smile: