Date Specific Objects?

I don’t know how to title this, other than I want certain game objects to appear depending on the date. Ex. a Pumpkin object only appearing on Oct 31st, a Holiday tree only appearing December 25th.

System.DateTime.Now will give you the current local date and time. You can then use that in any IF checks you like.

One simple way to do this would be to give the object a script where, on Awake, it checks the month and day-of-the-month, and if it doesn’t like the result, just calls gameObject.SetActive(false) to remove its attached object from play. (Though note that this only checks the date at the moment the object awakes, and won’t update if the date changes while the game is still running.)

2 Likes

Thanks for the advice, Antistone. I’ll try it out.