Anyway, you are basically describing a trigger volume, which is a basic Unity concept. Usually you'd have to use a collider set as "isTrigger" and script the functionality, but AC has it's own custom trigger script already. Just go to the Scene Manager, then look for the Logic category of prefabs which you can create, and you will find Trigger under it. Once you click, and name it if you want, hit add new and it will create a trigger volume already setup for you.
In the trigger you can setup actions to be run when a target object interacts with the trigger. The trigger will give you three trigger types: On Enter,On Exit and Continuous (The Continuous type is slower in all trigger volumes. It's a Unity thing, so try to avoid using it if possible). The types are pretty self explanatory, On Enter means that the actions will run when the target enters the trigger, On xit, only when the target exits the trigger. Continuous on the other hand will run the actions for as long as the target is inside the trigger volume. You can, of course, define who the target object is going to be. It can be the player, an specific object, it can be any object with a specific tag or component, or it can be anything which comes into contact with the trigger.
Have in mind you can drop another AC_Trigger script if you want the same trigger volume to deal with more than one type (ie: the same trigger volume can do On Enter and On Exit).
Triggers are covered at this point in the 3D tutorial - though it's recommended to watch the whole thing if you're new to AC. They are also used by the included 3D Demo to change the camera when the player moves to to the back of the room.
Comments