Download

Begin Overlap Trigger box to count score

What i am trying to do is when the player knocks down all 9 bottles (they all fall and hit the triggerbox below them) the player will get a win screen, this is what it loks like. But i cant seem to find something that works. Can anybody tell me how to make this work?

https://drive.google.com/open?id=0By8ISCXMLTC4WEN1LXRJTlg1QWs

Also i would like it to count only the bottles, and not the character projectile

Hi,

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:

  1. 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
  2. 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).
  3. 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).

Kind Regards

freakxnet

The bottles have their own BP so i can easily reset their position. I started trying that, i think to the problem was that i didnt check generate overlap events, possibly casting too. But i found a way to make it work. Thanks!