Forum rules - please read before posting.

Controller/Mouse Enable/Disable

Hi,

I’ve tried setting this up several times, but I’ve hit a wall and could use some guidance.

What I’m trying to do is show a prompt at game start that lets the player choose between two control schemes: Controller (Direct method + controller or keyboard) and Keyboard and Mouse (Point-and-click + mouse and keyboard).

Selecting Controller should set a variable to true, which enables alternate UI prompts; otherwise, the standard UI is shown.

I tried adapting the script from this thread:
https://adventurecreator.org/forum/discussion/11065/auto-detecting-mouse-and-or-controller-input

However, I’m running into issues with UI focus and refreshing after switching methods—UI elements fail to refocus on the visible elements, and when Direct control is active, the system mouse cursor can lock in place and randomly select UI elements.

I don’t need dynamic input switching based on player input. My setup is simple: each input has a Positive (keyboard/mouse) and an Alt Positive (controller), and this part works reliably.

Ideally, I’d just toggle a variable via an ActionList and switch the Movement and Input Methods, but Input Method doesn’t appear to be accessible from ActionLists. I’m considering creating a custom Adventure Creator action to control the Input Method directly. - But I'm unsure if that's the best way to approach this.

Any advice on the cleanest way to approach this would be greatly appreciated. I originally tried dynamic switching, but it introduced too many edge cases, so I’m aiming for a straightforward variable-based solution instead.

Thanks again for the help.

Comments

  • What are your AC/Unity versions?

    I'm not clear if the issue is down to the inputs themslves, or the changes that need to be made at runtime based on the chosen input method.

    Before incorporating the ability to switch method at runtime (even if it's just the once), I'd recommend playing the game with Direct / Keyboard+Controller enforced, to work out what other settings need to be changed, as well as determine if the issue is present when all settings are fixed as opposed to set at runtime.

  • Hi Chris, thanks for replying so quickly. I'm using 6000.0.31f1 Unity and 1.85.3 for AC. How do I do that (playing the game with Direct / Keyboard+Controller enforced). Thank you again.

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.