Forum rules - please read before posting.

How To Get Current Active Camera & TurnOn Off Menu By Name - Script

edited October 2014 in Engine development
Hello,

I'd like to do something interesting with a script, I'd like to check the current active AC Camera and dependent on which one it is change it to another via script,

2 things I need; 

How to to find the current active camera's name by script (not the mainCam but whichever gamecamera is active)
and how to switch to another camera by script

the other thing I'd like to do is; I have a button with a custom script and I'd like it to turn on a menu by script, I tried a few things but couldn't figure out the code to turn on the menu by name. I just need the specific code to tell it what menu to turn on / off

thanks.

Comments

  • Get the active GameCamera:

    AC.KickStarter.mainCameraPrefab.attachedCamera;

    Set a new active GameCamera and move to it instantly:

    AC.KickStarter.mainCameraPrefab.SetGameCamera (theCamera);
    AC.KickStarter.mainCameraPrefab.SnapToAttached ();


    Turn on "My menu":

    AC.PlayerMenus.GetMenuWithName ("My menu").TurnOn (true);

    (Or false to turn on without fading)
  • Wonderful this helps a lot thanks!


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.