How would i change the pitch of a song using a trigger?

Now im going to admit this is my first time using audio in a project, i want to make it so when you walk into this invisible box it will change the pitch of the song for a few seconds, for context im making a horror game and when you go out of bounds it will change the pitch of the song for a few seconds and then reset the level. but i only need to know how to change pitch with a trigger, thanks!

This is two separate problems. Figure out how to do each, then put them together at the end. If you can Debug.Log when you walk into the box, you can change the audio pitch (or do anything else).

For doing stuff when you walk into an invisible box, look into Trigger colliders. Here’s a quick tutorial about using colliders and triggers:

For changing the pitch of audio, you can just modify the pitch property of your AudioSource: Unity - Scripting API: AudioSource.pitch

Once you have both of these working separately, you can just call the audio changing code from the “when i walk into the invisible box” code.