Forum rules - please read before posting.

Running a 3D first-person game in simulator mode or on mobile

edited November 16 in Engine development

I am using Adventure Creator 1.85.3 and Unity 6000.0.62f1.
In the Adventure Wizard I select 3D -> First person -> Touch screen -> Context Sensitive
When I run the game in Unity in "Game" mode or build the project and run it on the phone, everything is ok. But when I want to test it and run it in "Simulator" mode (android device selected) or connect the phone via Unity Remote, the touch screen does not work.
I have specified in the project settings -> Editor -> Device - Any Android device and Joystick source - remote.
Do I need any additional settings to run the project without a build or does AС not provide such an opportunity?

Comments

  • Welcome to the community, @LenaB.

    To understand the situation: do you have both the Mobile Joystick and Input System Integration templates installed, such that you're looking to control your character using the on-screen joystick, with Unity's Input System?

    If you go to Window -> Analysis -> Input Debugger in the top toolbar, choose Options and then Simulate Touch Input From Mouse Or Pen. Does that cause inputs to be detected?

    Try also selecting the EventSystem_InputSystem prefab that the Wizard generated inside your game's InputSystem subdirectory (beside the Managers subfolder), and checking Use Enhanced Touch Support.

    Do either of these changes cause input to then be recognised?

  • Not exactly. I don't use the "Mobile Joystick" template. I just select Interface - Movement Method - Touch Screen.
    On the "Game" tab in "Game" mode, everything works as I set it in the settings.
    But it doesn't work if I switch to "Simulator" mode or connect my phone to run the game on it. If I build and create an .apk file, everything works. The problem is at the stage of launching the simulation during the development process.
    When I add "Touch Input From Mouse Or Pen", the screen stops responding to pressing both in game mode and in simulation.
    If I add a checkmark to "Use Enhanced Touch Support", the situation does not change - it works in game mode and does not work in the simulator.

  • Are you using Input System or Input Manager for your input handling?

    The issue may be that AC relies on mouse input when testing touch-screen games in the Editor, and - if I understand correctly - Simulator mode is still considered "in Editor" by Unity.

    If you open up AC's PlayerInput script, look for the following code block around line 263:

    #if UNITY_EDITOR
        if (KickStarter.settingsManager.inputMethod == InputMethod.MouseAndKeyboard || KickStarter.settingsManager.inputMethod == InputMethod.TouchScreen)
    #else
        if (KickStarter.settingsManager.inputMethod == InputMethod.MouseAndKeyboard)
    #endif
    

    Replace it with:

    if (KickStarter.settingsManager.inputMethod == InputMethod.MouseAndKeyboard)
    

    Does that then allow touch input to work?

  • Yes, that helped, thank you a lot!

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.