Forum rules - please read before posting.

How to wait for camera switch using a custom script

edited June 23 in Technical Q&A

As the title says, I have a custom script, and I'd like to wait for the camera switch (using KickStarter.mainCamera.SetGameCamera(newCamera, transitionTime);) to happen. I was expecting for some KickStarter.mainCamera.IsSwitching or similar, but nothing so obvious.

At the moment I'm just waiting for transitionTime, but I'm not sure it will always match perfectly or not.

Thanks in advance.


  • There exists an OnSwitchCamera custom event, which is called at the beginning of a camera transition. If the transition is later made instant, e.g. by skipping the cutscene it's a part of, then this will be called again with a transition time of zero.

    I agree that an "IsSwitching" property (or similar) would be useful, however - I'll look into adding this.

  • Thanks, that will be very useful. I can't easily use the event in my current code, so that property will be very useful indeed.

    Thanks again.

  • I forget myself: you can do a null-check on:

    AC.KickStarter.mainCamera.GetTransitionFromCamera ()
  • Ah, very useful, thanks, I'll use that for now :smile:

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.
Do NOT follow this link or you will be banned from the site!