How can I spawn items on a timer?

I have a garden I am testing this on, there are 3 different types of plants… They should act how lets say Skyrim plants would where I pick up the plant… I come back later and it has regrown…

I can have the object be there from the start, and can pick it up… But cannot find a way to respawn it after a certain amount of time…

103849-garden.png

Please help me find a easy way to do this… I need to be able to use this method throughout the entire world

I’m not sure if this is the best way of doing it, but it’s how i’d achieve this and pretty simple.

Create a “spawner” blueprint with an array containing the plants you want it to spawn.
Have it create the object on begin play.
When interacted with (the plant has been picked) it will run back to the spawn node, but through a Delay node and destroy the plant the same way you would’ve picking it normally
(Sorry for the crappy drawing, but basically this)

103861-diagram_01.png

Well inside of my “interact” type section… I delete actor on Pickup… So i think that, would get rid of the blueprint… But I will try to find a work around

There are a lot of ways to go about this but:

The easiest/most performant way I would think is:

  • OnOverlap, disable collision, set visibility to false
  • Delay time
  • Reset Collision and visibility

You can also just destroy the actor of course and have a world manager to respawn it.
You can teleport it to a “holding” area and put it back after a certain time.
And countless other ways.

1 Like