Quantcast
Channel: Answers by "dubbreak"
Viewing all articles
Browse latest Browse all 68

Answer by dubbreak

$
0
0
Here's a [tutorial on trigger zones][1]. It even has code to get you started. Basically what you want is a box collider (you can have it on a cube if you want so you can see it during editing, but you most likely want to turn the renderer off for the game.. unless you want to see the box you are crossing into) and set the collider "is trigger" to true. Is trigger will prevent it from acting like a physical box that stops you, but will still fire off a collision event (one specific for trigger called "OnTriggerEnter"). You'll still need to add your own code for checking it's the character that is coming into the border (or camera or whatever goes beyond the box border) then you simply play your audiosource clip (stopping your other one if need be.. various ways to do that depending on how you have your project set up). [1]: http://gardensandmachines.com/Gamedesign/03_TriggerTutorial_CB.pdf

Viewing all articles
Browse latest Browse all 68

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>