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

[1.0.0-preview.5] PlayerInput is executed on prefabs in the project view

Discussion in 'Input System' started by Saucyminator, Feb 18, 2020.

  1. Saucyminator

    Saucyminator

    Joined:
    Nov 23, 2015
    Posts:
    61
    Hi, I'm having some trouble with version [1.0.0-preview.5] (worked great in preview.3) where the scene inputs are being listened on my prefabs in the project view and ends up throwing
    NullReferenceException while executing 'performed' callbacks of 'Player/Attack[/Mouse/leftButton]'
    errors.

    As a test I created an empty scene:
    1. Added empty GameObject with PlayerInputManager
    2. Created a new empty GameObject, added PlayerInput component and made it a Player prefab, changed Behavior to Invoke Unity Events
    3. Referenced the new Player prefab in the PlayerInputManager

    I play the scene and I get calls to functions that only exist on my OLD Player prefab. My OLD Player prefab has the PlayerInput behavior of Invoking Unity Events and calls functions on a script that's attached to my OLD Player prefab.

    Using Unity 2019.3.1f1, Windows 10 Pro. Let me know if you want a gitlab link to my project.
     
  2. Zagganoth

    Zagganoth

    Joined:
    Oct 29, 2018
    Posts:
    1
    I am also experiencing this strange behaviour. For some reason playerinput keeps being called on my prefab and giving errors
     
  3. Rene-Damm

    Rene-Damm

    Unity Technologies

    Joined:
    Sep 15, 2012
    Posts:
    1,779
    Hi, would you mind filing a ticket with the Unity bug reporter? Just to make sure this isn't getting lost somewhere but gets properly tracked and verified by our QA guys.
     
  4. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    Is there a ticket you could share so that I can track progress on this? Also experiencing this.
     
  5. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    I'm getting also getting that error for a bunch of actions...

    eg.

    Code (CSharp):
    1.  
    2. NullReferenceException while executing 'performed' callbacks of 'Character/action[/DualShock4GamepadHID/buttonWest,/Gamepad/buttonWest]'
    3. UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
    4. UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/Input/Private/Input.cs:120)
    5.  
     
  6. transat

    transat

    Joined:
    May 5, 2018
    Posts:
    779
    I'm getting this possibly related error:

    Code (CSharp):
    1. Cannot find action 'HorseMovement/reload[/Keyboard/r,/DualShock4GamepadHID/dpad/left]' with ID 'a9ea6be9-f30b-4f57-a966-73b6d7cc1cf3' in 'StandardControls (UnityEngine.InputSystem.InputActionAsset)
    2. UnityEngine.InputSystem.PlayerInput:OnEnable() (at Library/PackageCache/com.unity.inputsystem@1.0.0-preview.6/InputSystem/Plugins/PlayerInput/PlayerInput.cs:1546)
    But I haven't used an action map called HorseMovement for a long time. Searching for that string in my project reveals that it exists in a few asset files: a character prefab I am no longer including in my scene, and in a few of my scene files, including the one I'm currently working on for some mysterious reason...

    Screen Shot 2020-04-10 at 8.03.25 pm.png

    Looks like the reference is a bit too persistent for some reason, @Rene-Damm ?