Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved Does the Unity Ads service require the old Input System?

Discussion in 'Unity Ads & User Acquisition' started by ejoflo, Apr 7, 2023.

  1. ejoflo

    ejoflo

    Joined:
    Sep 15, 2021
    Posts:
    41
    I've started implementing ads into my mobile game and right after following the initialization instructions, I'm getting this error:

    Code (CSharp):
    1. InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings.
    I only use the new Input System in my game. Is it safe to ignore this error message or is there a way I can remedy it? When I disable the the ads initialization script, the error message disappears. So I've concluded that this is caused by the Ads code.
     
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,520
    @ejoflo
    From my testing, it looks like the errors are coming from the UGUI package and they are because of the legacy Input Module on the EventSystem.

    The Ads package uses the UGUI system for the test ads shown in the Editor. If no EventSystem is in the scene, then it will add a new one, but it will have the old Input Module on it, which throws the error.

    The workaround would be to make sure there is already an event system in the scene and make sure to upgrade the Input Module to the new Input System UI Input Module (There is a button on the old module to automatically convert it). That worked for me in my tests to resolve the errors.
     
    ejoflo likes this.
  3. ejoflo

    ejoflo

    Joined:
    Sep 15, 2021
    Posts:
    41
    Your solution worked perfectly. Thanks for the guidance!