- Home /
How to provide inputs via Script?
I am trying to script inputs (e.g. so that I can have a script click the mouse button just like if the user had clicked it in a certain location) in order to playback recorded gaming sessions.
The documentation for the BaseInput class says that it can be used "to feed fake input to the UI" without having to write a custom InputModule. I have written a very basic implementation that extends BaseInput and overrides a few of the functions and can provide it if needed, but at the moment I believe my question is more basic than that: How do I use it? I have tried putting it on the EventSystem, but when I run it still creates a BaseInput which seems to be handling all of the input, and none of the input that I've tried to send through my subclass (e.g. by having GetMouseDown return true for a brief period to simulate a mouse click) seems to be having any effect. (I have spent a couple of hours with Google and here in the forums looking for others who have done this, but I haven't found anything.)
Your answer
Follow this Question
Related Questions
Can I Simulate the "Submit" Event with Gamepad Buttons? 0 Answers
Is there a way to modify Input Manager so that an ax is be able simulate an input from code? 0 Answers
How do I add a value to anywhere Input.GetAxis("Horizontal") is called? 1 Answer
Implicit "Horizontal" Axis exceptions? 1 Answer
How would I get a button press to override/combine with currently held buttons? 2 Answers