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. Dismiss Notice

Resolved Null Reference Exception

Discussion in 'Input System' started by NLTG, Apr 29, 2023.

  1. NLTG


    Apr 29, 2023
    Hello,i am using the latest version of the new input system and i get a NullReferenceException.
    For some reason pi is null.
    I am using the automatically generated C# wrapper class.
    From what i understand the wrapper class is a class with a nested interface inside and i should be able to instanciate it just fine.
    If anyone can help me its much apreaciated-)

    Code (CSharp):
    1. PlayerInput pi = new PlayerInput();
    2. ...
    3. void OnEnable(){
    4.     pi.Enable();
    5. }