Having multiple actors able to trigger same event in level blueprint?
Hi! I'm having an issue getting multiple actors to trigger the same event in a level blueprint.
This is a VR project and in my level I have many snowball actors that I can throw at a target. I have a variable in my level blueprint that counts when the snowball hits the target. When the target it hit, the OnActorHit for that target is triggered in my level blueprint and the score is increased by 1.
In addition to having the number of "hits" counted, I also need to count the total number of snowballs actually thrown so that I know how many are missed. The snowball actor blueprints are each able to detect when they are thrown (so they can play a "whoosh" sound). Every time a snowball is thrown, I want that snowball to increase the "thrown" variable in my level blueprint by 1.
I've looked into Event Dispatchers, but they seem like they are used when a single blueprint needs to talk to many other blueprints, but not when many blueprints need to talk to a single blueprint like in my case.
How would I accomplish what I'm trying to do?
Instead of using the level blueprint, which can be a pain to communicate with, I would use a custom Game Mode. The game mode can be accessed from almost any blueprint. To communicate with the Game Mode, I would use Get Game Mode and Cast to the specific type of game mode. Or even better, I would look into using Interface Blueprints.
If you don't know, Interface Blueprints are amazing tools that allow a bunch of different blueprints communicate with a single blueprint, or a single blueprint communicating with a bunch of different types of blueprints.
answered Dec 22 '17 at 07:44 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here