Forum rules - please read before posting.

Trigger cutscene on walk

What would be the best way to trigger a cutscene by walking into a particular area? 

I don't want a hotspot with label, I just want the player to walk into an area and something will trigger.

Comments

  • edited May 2017
    Hi, and welcome to the AC forums @robinvr

    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).
  • edited May 2017
    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.
  • Does this method work on a 2D game?
  • Yes - there is a "Trigger 2D" equivalent prefab listed in the Scene Manager when you are making a 2D game.
  • @alverik & @chrisiceBox Thanks! It's working now
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.