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 Simulating joystick input with C#

Discussion in 'Scripting' started by NOT_A_ROBOT1101, Oct 26, 2020.

  1. NOT_A_ROBOT1101

    NOT_A_ROBOT1101

    Joined:
    Jun 18, 2020
    Posts:
    39
    [TL;DR: I found a way to simulate keyboard input, but how do I simulate joystick input? Do I need to make my own device driver?]

    So I was playing a game one day, and thought that it would be cool to use my phone as the controller.
    I made a program that could do that, then I need to find a way to make a joystick.
    It was easy enough, but I was stuck on trying to simulate joystick input. In the Internet I found a way to simulate keyboard input using C#, but not joystick input.
    One source said that you need your own device driver to do that.
    Is this true? If not, then how do I do it?
     
    Last edited: Nov 6, 2020
  2. NOT_A_ROBOT1101

    NOT_A_ROBOT1101

    Joined:
    Jun 18, 2020
    Posts:
    39
    I use ViGEm, it works perfectly!
     
  3. MDADigital

    MDADigital

    Joined:
    Apr 18, 2020
    Posts:
    2,198