Forum rules - please read before posting.

Camera: Switch - being disabled when selecting menu options

edited July 2020 in Technical Q&A

AC Ver: 1.71.4
Unity Ver: 2019.2.4f1

Hello folks,

At the start of my main menu scene I am using a Camera: Switch to set up the shot, like so:

.

This is all good while the main menu is on screen. But when the player selects 'option' from the main menu then this occurs:

The switched camera is suddenly lost.

The option itself is setup like this:

And the option menu itself:

Any clues as to why the camera would suddenly change?

Comments

  • edited July 2020

    Actually, I'm noticing even odder behaviour; the game camera seems to be used if just enabled in the hierarchy. It doesn't even need to be called using Camera: Switch.

  • I think I know a bit more what is going on, or at least, some things to fix first and foremost. It seems when the main menu has appeared, moving the mouse around the UI is also rotating the player object in the scene.

    I suspect that's responsible for the random camera angle that is then displayed when selecting 'option'.

  • What's your "Movement method" set to?

    Since the game isn't paused during this time, the Player will still respond to input as though you're in normal gameplay. You can prevent this by using the Engine: Manage systems Action - either to disable the Movement system, or switch the "Movement method" to "None" - for the duration of the scene.

  • edited July 2020

    Thanks Chris, using Engine: Manage systems and setting movement to "disabled" is stopping the player object from receiving any rotation so that definitely feels like a good first step.

    I'm still getting a camera change when selecting an option but I'll send you a PM. I think I need a bit of a review and audit of my setup.

  • edited July 2020

    Ok, I've done a bit more debugging into this. I added Debug.Log(attachedCamera.name); into a FixedUpdate in MainCamera.CS to clearly output what camera is being used.

    This is what I see:

    The good news is the (now a) SimpleCamera is definitely being used at the start, but at the point of menu interaction it switches to the camera on the player object. I can't see any logic which would make this switch - there aren't any action lists being run which would make the camera change.

    Is there some default menu interaction logic that might be doing this? Is it possible to debug were the camera change is coming from?

  • edited July 2020

    I've resolved this particular problem in my project by removing the camera from the player object (it makes no sense that its present in a main menu scene). This seems to force the use of the SimpleCamera throughout.

    Still curious though what might have been making it switch.

  • If your game is First Person, then AC will automatically switch to the Player's FirstPersonCamera (if found) whenever you enter gameplay.

  • Sorry Chris, totally skipped over your first question - yes, the movement method is set to first person.

    Cool. I'll remember that in future!

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.