Forum rules - please read before posting.

Mouse Cursor and Controller navigation in menus.

I have a game using both First Person and Third person set ups. I am using the game set to Keyboard and Controller, so gamers control player using a controller, and or mouse/keyboard to move about in 3D Space, or navigate close-ups scene using a cursor.

But, I am having issues with menus and cursors.

If I display a menu (I have various types) I can only navigate using the controller, and can’t get the cursor to display when I have menus set to Pause Gameplay. If I don’t have menus on Pause the player character can be moved about and menu navigation via controller stops if not. If I set a menu to not use Pause, I can get the cursor to display, but I have issues such as the third person camera moving about as the cursor moves, or when in first person mode, the player can walk about still despite locking movement in action scripts.

Am I missing something?

Thanks





Comments

  • You can use the Player: Constrain and/or Engine: Manage systems Actions to limit the player's ability to move and interact.  If one of them doesn't seem to be having the effect you were expecting, please post more details as well as AC/Unity version numbers.

    Placing these Actions in your Menu's ActionList when turn on/off assets can therefore enable and disable systems when a non-pausing Menu is turned on.

    The Engine: Manage systems Action can also be used to allow for direct-navigation of Menus during gameplay.

    If you're relying on a custom motion controller, you can alternatively hook into the OnEnterGameState / OnExitGameState custom events to disable/re-enable the controller when the game enters the Paused state.
  • edited October 2018

    I think I am dealing with multiple elements at once, so I’ll try and break this down.

    1: Adding player constrains keeps my Character from being able to move about during menus. Solved thank you.

    2: The Third Person Camera continues to move about - that camera is set to use mouse movement or Right Joystick of a controller. When a mouse cursor is toggled on for a menu, the Third Person Camera flies around still behind.  I do not have  menus set to Pause the game. I have the game set up to use Keyboard and Controller.

    So - How can I stop the Third Person Camera moving? Can I change the Third Person camera Input Axis via an Action Script at runtime? I could just set Input Axis to be ‘nothing’ for example and then back to normal when a menu is closed. If so, what code Action Script would do that?

    3:  I have a cursor moving about to click menu items (controlled by mouse and controller right joystick), so a controller can no longer jump between menu buttons for Direct Navigation? How can I implement both? If menus Pause Game, I have controller Directly-Navigate working, but anybody using a mouse can’t use the menus.





  • 2. You can use the Engine: Manage systems Action to disable the Camera system, which will prevent updates being made to the Third Person camera (I'm assuming you're referring to AC's provided GameCameraThirdPerson here).

    Alternatively, you can indeed change the input axis at runtime - see the scripting guide's entry on the spin axis here.  You can retrieve the active GameCamera with:

    KickStarter.mainCamera.attachedCamera

    To get the GameCameraThirdPerson class, you can cast it:

    GameCameraThirdPerson thirdPersonCam = KickStarter.mainCamera.attachedCamera as GameCameraThirdPerson;
    if (thirdPersonCam != null)
    {
      // Set the axes to empty
      thirdPersonCam.spinAxis = "";
      thirdPersonCam.pitchAxis = "";
    }

    This can be placed either in a custom Action, or within a public function on a regular C# script called via the Object: Call event or Object: Send message Actions.
  • 3. If you want to use a mouse, you need to have your Input method set to Mouse And Keyboard.

    Inputs taken from a controller should still work in this mode, but you can optionally change the input method on the fly when a pausing menu turns on if on desktop using the OnMenuTurnOn custom event:


    For more on custom events, please see the Manual's chapter of the same name.
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.