How can I make background audio change with the time of day?

Hello, I am working on designing an environment for my class, and I wanted to know if it was possible to make a script or function where I can have a background clip play for day time and a different one play at the night. I do already have a day/night cycle.

I attached the day and night cycle script below.

4090513–357139–TimeController.cs (1.33 KB)

Sure, why not? You could have two AudioSource references, and call .Play on the appropriate one. Or, you could have a single AudioSource and two AudioClip references, and then assign the appropriate clip to the AudioSource before telling it to play.

I guess I’m not clear on exactly what the difficulty is you’re having.