How to simulate mouse input?

Hi guys

I’m developing a videogame using the Kinect for Windows device.
My question is simple: How can I simulate mouse input? I know the SendKeys class in C#, but I haven’t figured out how to do it in Unity.

What’s the best way to simulate mouse input from code?

Thanks in advance

Try putting an additional layer of abstraction in between Input and game code. I usually create some sort of input manager that grabs the input and then either stores or forwards it to the relevant pieces of game logic. Makes things a little bit more complicated, but you can easily change or switch your complete input handling and even write tests for incoming input commands without ever touching the game logic. And of course you can just add code that randomly calls the “handleMouseInput” function :slight_smile: