Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Controls not working in game/play mode

Discussion in 'Getting Started' started by iamcyanblue, Jul 25, 2022.

  1. iamcyanblue

    iamcyanblue

    Joined:
    Jul 15, 2022
    Posts:
    7
    My Unity editor does not respond to any keyboard or mouse interactions when I press the play button to go into the game mode. The controls work fine in Scene mode. It's been working so far today, but about 5 hours ago completely stopped responding to mouse dragging, or right button + WASD. The view is stuck in the initial camera position.

    I've tried the following:
    - restarted the editor
    - restarted the hub
    - restarted my mac
    - deleted and reinstalled the editor and hub
    - tried different LTS version of the 2021, 2020 editors
    - opened previously working projects
    - disconnected external mouse, keyboard, monitor
    - set game view to "Maximise on Play"
    - in project settings "Active Input Handler" is set to "old"

    I'm using editor versions 2021.3.6f1 and 2020.3.37f1 and Hub 3.2.0. Running on macOS 12.5
    Can anyone help? I'm losing my mind a bit!
    Thank you.
     
  2. G_Trex

    G_Trex

    Joined:
    Apr 20, 2013
    Posts:
    97
    It sounds like something has happened to your input manager.

    In Project Settings > input manger, are all of your inputs still there?

    Did you add an asset from the package manager that might have overridden the old inputs?
     
  3. iamcyanblue

    iamcyanblue

    Joined:
    Jul 15, 2022
    Posts:
    7
    Thanks, I've attached screengrabs of my Project Settings > Input Manager and my Package Manager. Do any of these look to be at fault?
     

    Attached Files:

  4. G_Trex

    G_Trex

    Joined:
    Apr 20, 2013
    Posts:
    97
    Is this just for the camera and control you get in the sample scene?

    If so, do you still have the sample scene, and does the camera work there?
     
  5. iamcyanblue

    iamcyanblue

    Joined:
    Jul 15, 2022
    Posts:
    7
    The Project Settings screengrab is from the example project (Beachside Town), from the Creative Core tutorials.
    When you say Sample Scene, do you mean the "3D Sample Scene (URP)" that looks like a construction site?
     
  6. G_Trex

    G_Trex

    Joined:
    Apr 20, 2013
    Posts:
    97
    Yes.

    Can you still move around the construction site? Is it part of your project?

    Also, have you been able to move around the Beachside town project before your camera/controller stopped working?
     
  7. iamcyanblue

    iamcyanblue

    Joined:
    Jul 15, 2022
    Posts:
    7
    Yes, I'm able to move around the construction site template project ok. And I was able to move around the Beachside town project for a couple of days until it stopped responding last night. The scene itself isn't frozen, because the sea and two characters are animating - it's just the controls not working.
     
  8. G_Trex

    G_Trex

    Joined:
    Apr 20, 2013
    Posts:
    97
    How about :

    - Take the camera from the construction site
    - Turn it into a prefab
    - Drag and drop the prefab into your beach scene
    - Set the old camera to inactive in the inspector
     
  9. iamcyanblue

    iamcyanblue

    Joined:
    Jul 15, 2022
    Posts:
    7
    Because I'd deleted the construction site scene from the beach scene/guided tutorial project, I had to recreate the construction scene again from the template, convert its camera to a prefab, then copy its .prefab and .prefab.meta files into the beach scene's project directory/folder. That worked once I'd disabled the pre-existing/non-working camera.

    Though, when I added a new camera to my scene using the GameObject menu (instead of using the .prefab method), this new camera wouldn't work (I remembered to disable the other camera). I've just noticed an "XR" folder in my Assets, which contains "XRGeneralSettings". Might that be causing the problem?
     
  10. iamcyanblue

    iamcyanblue

    Joined:
    Jul 15, 2022
    Posts:
    7
    I hadn't realised that a camera requires a script to move it around the screen in a POV manner! I understand now - copying the camera from the construction site worked because it had a simple camera control script component attached.
    Thanks for all your help :)