Object Spawner

Hello,

I’m trying to figure out the following and i would appreciate any input from the fellow developers.

Id like to have the player capture the flag( or an object like check point, OnEnterTrigger basically) , then spawn an object on the opposite of the checked point.

The spawned object should last 10 seconds, if it detects player, it stays on and potentially the player takes control of it.

If the spawned object does not detect player, it leaves ( Hopefully with an Ai, Navmesh).

Then the player is able to catch/ trigger another flag to get another spawn object…

Basically it is a character stuck on an island, and in order to leave the island, it has to get to the boat, however the boat is only available for a limit amount of time. However the player can try to capture another flag to get access to another boat.

I hope i don’t sound insane and was clear enough, Please see the attached image.

you can use OnTriggerEnter to enable/spawn the object, then in its Start/OnEnable method you launch a coroutine that will disable the object in ten seconds unless it detects the player.