Forum rules - please read before posting.

Change the perspective mode in runtime

My game is set to 2.5D mode,but I need some features of 2D mode such as 2D pathfinding and scrollable background in some scenes.
I tried to load AC's 2D demo with my own ManagerPackage,which is 2.5D setting.Definitely, the cutscene,pathfinding and hotspots were all invalid(pathfinding only works in X axis).Then I changed the Camera perspective to 2D manually in runtime,everything became fine.
I found the variable in SettingManager.cs,can I simply change my game's perspective mode by changing the value of AC.KickStarter.settingManager.cameraPerspective?Will this cause any problems?

Comments

  • You can certainly change camera perspective through script, but the scene it's changed for must be set up to make use of it - the Scene Manager alters itself based on the value.

    Know that you can still use the GameCamera2D prefab in 2.5D scenes, which allows for scrolling.  You'll have to rely on 3D NavMeshes still, but otherwise that would avoid you having to change perspective mid-game.
  • OK,if I made a scene full of 2D gameObjects like hotsopt2D,trigger2D,navmesh2D,etc,when I change from other 2.5D scenes and use script to set AC.KickStarter.settingManager.cameraPerspective equal to 2D,all of the 2D gameObjects will work correctly,is that so?
  • edited September 2017
    Should do, for best results you may have to change the perspective just before the scene change.
  • Can I do it through "on load cutscene"?
  • Yes, should be fine.  Likely you'd want it in a shared Cutscene/ActionList asset that both the OnStart and OnLoad cutscenes call upon.

    If placed in an ActionList asset, you could also make use of the Scene Attributes feature so that the same asset can be run for all scenes, and set the perspective accordingly.  More on Scene Attritbues can be found in Section 7.6 of the Manual.
  • I've noticed that,this feature will save my time.

    Thanks Chris,have a nice day.
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.