some more information would be great. What are the bottles? Static Meshes? Blueprints?
Here a short way how I would prototype a quick version of it:
- Create a “BP_GameController” which contains the function
=> BottleHit() (or whatever)
=> this function increments then an internal counter for you bottles
=> if bottle hit == bottles in level show win screen
- I would create a blueprint “BP_Bottle” which contains the bottle itself. The make sure that “Generate Overlap Events” is enabled (or physics with hit event, sometimes its kinda strange to me).
- Create a “BP_TriggerBox” which contains the trigger box itself
=> Assign “BP_GameController” to this BP
=> Add overlap event begin event to this BP
=> Cast the overlapping actor to “BP_Bottle” if cast failed ignore it simply
=> If cast is valid call “BP_GameController.BottleHit()”
(4) If you want to have only a specific amount of tries:
=> Add counter for tries to “BP_GameController”
=> Add function “Throw()” to “BP_GameController”
=> increment throw counter
=> If throw counter >= maxThrows then show game over
=> On throw call then “BP_GameController.Throw()”
This would be a starting point for me (probably it would be better to use the game instance for the counters but to have a first step this should be fine).