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

Question How to write a script that support both Legacy Input and New InputSystem for any input setting

Discussion in 'Input System' started by ryanflees, Jan 10, 2023.

  1. ryanflees

    ryanflees

    Joined:
    Nov 15, 2014
    Posts:
    59
    Hi, I'm writing an addon and need to a FreeCamera script for the addon demo.
    The users might use any input setting in Unity, could be old, new or both. So I want the FreeCamera to work correctly in all cases no matter how users set their player setting.
    However I don't know how to make the FreeCamera input to support all 3 possiblities. And I can't find any related examples.
     
  2. ryanflees

    ryanflees

    Joined:
    Nov 15, 2014
    Posts:
    59
    Ok , i find that I could use
    #if ENABLE_INPUT_SYSTEM marco