Search Unity

Resolved Input system stops working on UI objects after LoadScene.

Discussion in 'Input System' started by hkplay, Jun 4, 2021.

  1. hkplay

    hkplay

    Joined:
    Jan 4, 2021
    Posts:
    12
    EDIT: Sorry for the confusion... I had accidentally left another player input inside of "Player" object... i removed it and now it works. Curious why it works in the first place, but fails after scene reload. Please remove this thread if possible.


    Hello as described... I have one Player Input set to Broadcast messages in a "Controller" object. This object has two children, a "Player" and a "Canvas". Some objects under "Player" uses the input system for moving, while some UI Elements under "Canvas" uses the input system for misc things (such as pressing P for pause menu).

    I have found out that upon reloading the scene, the inputs for "Player" work as per normal, but the inputs for all my UI elements do not work. I can still move my player but pressing P for the pause menu does not work anymore.

    Does anyone know why this happens? I am sure its has something to do with Scene reloading and Canvas.

    Btw this is my scene reloading function:


    Code (CSharp):
    1. Scene scene = SceneManager.GetActiveScene();
    2. SceneManager.LoadScene(scene.name);
     
    Last edited: Jun 4, 2021