Choose a point and create object

hi guys… I have some spawn points within the map and I would like to make a chest appear in one of them.
the problem is that chests appear in all spawn points while I would like it to decide one of the points

It’s picking a random spawn point and checking if it has an object linked to it. Since the timer is still running, after 3 seconds it keeps checking if a random object is linked. The trigger once would normally work as a trigger once but the random condition is resetting the trigger once every time it randomly chooses a spawn object that already has a link. I hope that makes sense.

If you only want 1 object then you could delete the timer or use a Boolean variable.

ok now only one chest is created but when I go to open it it doesn’t take the timer into account and no others appear

I’m not sure what you want to happen. Are you adding just 1 object? Or one at a time? Or 1 per spawn point? I’m not sure what the link is for.

I would like a chest to be created in a random spawn point… once the player opens the chest he recalculates the time and recreates another chest again in one of the spawn points and so on

How are the chests being opened? Is it the opacity tween? I’m not sure you need the linking.

At beginning, start timer

Pick random spawn

Action : create objects, tweens, delete timer

Opacity tween is finished
Delete opacity tween or the object the object that was tweened, then restart the timer

If the tween or timer isn’t deleted, they will keep triggering the events. If the timer is deleted, it doesn’t need any other conditions to prevent it from not being triggered. It’s always best to delete tweens unless the object is being deleted.

ok this seems to be working thank you very much

1 Like