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

Bug Assertion Error on Destroying a PlayerInput or Unpairing a Device from It

Discussion in 'Input System' started by aydin_khp, Jul 12, 2020.

  1. aydin_khp

    aydin_khp

    Joined:
    May 15, 2020
    Posts:
    29
    Hi,

    I want to destroy the gameobject which has a PlayerInput when the device paired to it gets disconnected; However calling Destroy on the object leads to an Assertion error as follows:

    Assertion failed
    UnityEngine.InputSystem.LowLevel.<>c__DisplayClass7_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*)
    UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)


    I get the same assertion error when I try to unpair the disconnected device using:

    playerInput.user.UnpairDevice(playerInput.devices.First());


    Look forward to hearing from you.

    Regards,
    Aydin
     
  2. aydin_khp

    aydin_khp

    Joined:
    May 15, 2020
    Posts:
    29
    I won't get any errors when I destroy the GameObject the PlayerInput is attached to; Destroying the GameObject works for me but I don't think receiving assertion errors for Destroying PlayerInput component be reasonable anyway.