To be more specific, I want my player to trigger enter 4 different instances of BP1 (A-D). A should start off as enabled, and once the player gets to A, B will become enabled and once the player gets to B, A will be disabled and C will be enabled, and so on…
I would also like to be able to do this with multiple blueprints, not just different instances of the same blueprint.
I am still a newbie at UE4 so any links or info you can give me for this is very much appreciated. I am currently trying to use a BP Interface to pass through different BP variables that I could try to set as enabled/disabled, but I am not absolutely sure how to set and pass these flags, and I am also not sure how to target different instances of the same Blueprint from the scene (BP1-A, BP1-B, etc…)
You can use a single Get All Actors of Class node, use a ForEachLoop with the returned array, and with each array element, cast to the class and save the returned value as a variable. You can use a Switch to make sure each index from the array is stored as the appropriate variable.
Since you’re new, I’ll explain what the logic is here so you aren’t simply copying it.
Get All Actors of Class will create an array containing every instance of that class that is currently in your level.
The ForEachLoop performs actions for each element of that array with its Loop Body.
Casting to the class will give access to any public functions, events, and variables within that BPs instance, and will affect ONLY that particular instance. You have to provide the BP in the Object input pin, which we are doing from our Get All Actors of Class’s Array Element.
The switch reads which array element it is via integer, and sends it off in a different direction depending on the incoming integer. The ForEachLoop conveniently provides this automatically.
Finally, we are storing these BP instances in variables. You’ll now have access and control over these BP instances at any time with these variables.
Thank you Gage for such a quick response! This seems like a very intuitive way to do this, I wish it wasn’t hidden in the blueprint functionality =\
After I set up the different instances of the blueprint, I am still not quite sure how I am supposed to say in blueprints that the player is interacting with the separate instances. For instance, in this BP example here, I have multiple firepit locations, but whenever I ask what the player is running into, it prints to screen the same instance ID of the blueprint.
Sorry, I don’t quite understand. Are you trying to use an overlap event to affect a particular instance based on some circumstance? Can you explain exactly what’s happening and what you’re wanting happen?
If you used my setup in your player BP and established those variables sometime before you’d be dealing with these overlaps, you can cast to your character using the Other Actor of the overlap and call a custom event from that. So you’d make custom events in your player that specifically affect one of those established instances