How can i make it so you can only hear a certain music if you are inside a certain place?

Basically, how can i make it so a player hears a certain music if they’re in a certain place of the map and another music in another place of the map?

3 Likes

You could try using a touched event to play the sound or maybe use 3D sound to play it.

1 Like

Sound regions! YouTuber AlvinBlox covers it pretty well in this Roblox Scripting Tutorial.

2 Likes

If you don’t have 3D or layered regions that you’re looking to play sound over, another method I would recommend is downcasting for a certain music trigger instead of using Region3. Super inexpensive to run a single raycast downwards from the HumanoidRootPart over a select amount of objects - just don’t make said ray too long. 100-200 studs is enough, maybe even less. If you need to, chain short rays down for music triggers over n iterations.

1 Like