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.

Resolved First Person Starter's input system doesn't work on WebGL

Discussion in 'Input System' started by bawenang, Jun 17, 2022.

  1. bawenang

    bawenang

    Joined:
    Aug 18, 2012
    Posts:
    116
    Hi,
    I have actually created another thread with the same issue on Cinemachine forum since I don't know where should I put this. You can tell me to delete one of them if you want me to. I'm trying to run the First Person Starter on WebGL and it can't move using the WSAD+mouse input like in the PC/Mac/Linux build. It said this:

    This is the faulty line:
    Code (CSharp):
    1.         private void Start()
    2.         {
    3.             _controller = GetComponent<CharacterController>();
    4.             _input = GetComponent<StarterAssetsInputs>();
    5. #if ENABLE_INPUT_SYSTEM && STARTER_ASSETS_PACKAGES_CHECKED
    6.             _playerInput = GetComponent<PlayerInput>();
    7. #else
    8.             Debug.LogError( "Starter Assets package is missing dependencies. Please use Tools/Starter Assets/Reinstall Dependencies to fix it");
    9. #endif
    10.  
    11.             // reset our timeouts on start
    12.             _jumpTimeoutDelta = JumpTimeout;
    13.             _fallTimeoutDelta = FallTimeout;
    14.         }
    15.  
    Does anybody have any idea how to fix this? Thanks.
     
  2. bawenang

    bawenang

    Joined:
    Aug 18, 2012
    Posts:
    116
    Hi,
    So after browsing some more, I found out that we should also install the `Starter Assets - First Person Character Controller` from the Asset Store. It is working now. Thanks.
     
  3. devonpmack

    devonpmack

    Joined:
    Dec 14, 2017
    Posts:
    1
    For me the fix was to add this script symbol to WebGL in the Player settings for the project

    upload_2022-7-25_22-21-51.png
     
  4. unity_FCF1614A4541ADFFCAB3

    unity_FCF1614A4541ADFFCAB3

    Joined:
    Feb 25, 2022
    Posts:
    3
    I get the error message even when I try to run the game in the editor.
    Downloaded and imported the First Person Controller from the Package Manager. Used Tools -> Reset First Person Controller to use it.
    Reinstalling dependencies did not help.
    Unity 2021.5.f1
     
  5. unity_FCF1614A4541ADFFCAB3

    unity_FCF1614A4541ADFFCAB3

    Joined:
    Feb 25, 2022
    Posts:
    3
    SOLVED: The problem was that I had not enabled the New Input System
     
  6. fourplayers

    fourplayers

    Joined:
    Dec 18, 2020
    Posts:
    1
    Had the same issue in the Third Person Controller Demo. As devonpmack pointed out, adding the STARTER_ASSETS_PACKAGES_CHECKED to the Scripting Define Symbols worked.
     
    fjolne likes this.
  7. Zotooo

    Zotooo

    Joined:
    Aug 14, 2022
    Posts:
    1
    Just add this to in script compilation STARTER_ASSETS_PACKAGES_CHECKED
     
  8. rctech14

    rctech14

    Joined:
    Apr 11, 2021
    Posts:
    1
    This is solved on the Editor with me whenever I add the STARTER_ASSETS_PACKAGES_CHECKED, yet when I build the project and run it. It is not fixed in the browser, please find a solution for that
     
  9. roseblackpink

    roseblackpink

    Joined:
    Nov 24, 2022
    Posts:
    1
    any solution?