I’m developing a game with a friend, and I need some advice. So there is a safe zone which is represented by a small island and I delimited it with a trigger box. I would like to know, or have some advice on how to create a mechanism that would allow players to win the game once a certain number of resources (blueprint class) have been deposited in the safe zone (trigger box).
Looks cool, and sounds fun! I think what you would want to do if leverage an event for the trigger box you placed for your “safe zone”: Trigger Actors | Unreal Engine Documentation
Maybe conduct a check that the resource is what overlapped the trigger box, and increment some variable that relates to your win condition.
Now, it’s tough to say from there how that variable should be setup without knowing more. For a prototype, you could use the level blueprint to store the variable.
You may want to use a custom event, just depends on how you go about it. But in summary: use an event from the trigger box. Store the variable somewhere. Change that variable by binding the event to it.
Everynone, your example works very well, I would never take your proposal, but I would like to know how I can add differents classes of resources (blueuprints), like it takes 2 plants, 3 woods and 4 fabrics to finish the game ?
There’s probably a bunch of different ways, some better than others. How to do it depends on the requirements. Check this out, it’s pretty generic and should be easy to maintain: