Make objects appear at a certain time

Create a TMap where the key is the time and the value is whatever you want to schedule.
Update your time every second instead of on tick to save performance, and when the time updates check if the scheduled task time >= to the current time, if it is execute whatever you need to execute

EDIT: correction, instead of making the key of the TMap a time, make it a start time and end time struct, and check if the thing to spawn is within the start and end time, this way if you skip a day you don’t get a bunch of random stuff happen and things will execute only within their timeframe

1 Like