Search Unity

Resolved Weird issue with the input system in UVS

Discussion in 'Visual Scripting' started by Marou1, Dec 23, 2022.

  1. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    161
    Hi,

    I am experiencing a recurrent behaviour that seems to me like an issue.

    Let's say you have a script A with this:
    upload_2022-12-23_10-25-9.png

    If this script A is attached to 2 objects and they are both enabled:
    => Pressing the key will trigger an action as expected in both occurrences of the script A.(The 2 objects will perform the expected action).

    If you disable the first object:
    => Pressing the key will not trigger anything even in the script attached to the second object that is enabled. It's like the input system is disabled in all occurrences of that script A.
    If you have a different script B that is attached to that second object, the input will work fine in the script B, but not in the script A.

    This means that the input system is working everywhere else but not in the occurrences of the script A.
    If you have 10 objects with the script A, you disable one of them, the input system will stop responding for the 9 others.

    I am using a workaround:
    I created an empty game object with the script A. And each time I disable one object that has the script A, I have to disable the empty game object then enable it to make the input system work again in all occurrences of the script A.

    For me, this behaviour does not make sense.

    Am I missing something?

    Thanks
     
  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,076
  3. Marou1

    Marou1

    Joined:
    Dec 13, 2021
    Posts:
    161
    Ok, I will report the bug.
    However, is this the right way to use the input system?
    When I attach a script using the input system to a prefab, I cannot edit it. I understand this is because it is calling a scene variable that does not exists in the prefab, but what would be the right way to do it?
    upload_2022-12-23_15-45-1.png

    When I place the prefab in the scene, I still see this:
    upload_2022-12-23_15-47-12.png

    I need to remove the node and recreate it. It doesn't bother me, but I'm just wondering what would be the best way to call in the scripts the game object that has the input system?
     
  4. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,076
    Report that as a bug too, you're one of the first devs who are seriously testing this new implementation. Apparently, it has a lot of edge cases Unity didn't test for and you're now discovering them.
     
    Marou1 likes this.