Forum rules - please read before posting.

Trigger Script Detecting on Scene Change?

edited April 2021 in Technical Q&A

Hi! It's been a while :)

I wondered if it were possible for AC_Trigger script (or any other work around) to be able to run some extra code or an actionlist when the player walks into a trigger that triggers a scene change.

I have tons of scene changes in my game (maybe about 35), and when walking into a door, there's a trigger which takes player to the related scene. I was thinking of making it more fluid by fading out the camera and stopping player movement (so theyre not running into the wall while the camera is fading out)

I could do this by adding those actions to every single scene changing trigger, but would that be ok optimization-wise? I'm making this game for low-end Android systems and wanted to keep it as simple as possible... So I was wondering if I would be able to check within trigger script whether the trigger cutscene contains the scene change action and if so run that extra bit of code instead? If that makes sense.

Or maybe a way to run an actionlist after detecting a scene change?

Or maybe I'm overthinking it lol

What do you think?

Comments

  • edited April 2021

    Once a scene-switch command has been triggered, it can't be paused. Any other commands, like camera-fading, need to be issued beforehand.

    To optimise the process, you can have your Triggers reference a single ActionList asset that uses a parameter to set the new scene.

    A tutorial on parameters can be found here, but the steps are essentially:

    1. Create a new ActionList asset with the intended Actions (Camera: Fade, Scene: Switch, etc)
    2. At the top of it's Inspector, enable parameters and define either an Integer or String parameter, depending on how you want to reference the new scene (i.e. build index number or filename)
    3. Use this parameter to override the new scene field in the Scene: Switch Action
    4. For each of your Triggers, remove the existing Actions and set the Trigger's Actions Source field to Asset File, and assign the ActionList asset
    5. Again for each Trigger, attach a Set Trigger Parameters component and set the new scene value in it's Inspector
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.