Hi,
am I doing something wrong or the InputRecorder isn’t able to playback recorded input when the window doesn’t have a focus?
I want to record input and then play it back in batchmode when my playmode tests are being run. Based on the results of the tests (the ones with the input recorder are failing) and the fact that it seems unable to playback in a regular editor when the gameview isn’t focused, I am guessing that there is something related to that.
Am I correct? If so - is there anything that could help me run input playback in batchmode?
After a fair amount of digging through the forums and documentation, I’ve found BackgroundBehavior
and PlayModeInputBehavior
settings. I’ve tried to set those up to Ignore and AllDeviceInputAlwaysGoesToGameView respectively.
Sadly that doesn’t make any difference in my case. Events (in the UI & game objects with EventTrigger components) aren’t being recognized properly unless I at least hover over my game view.
Well, to be clear - it does make a difference when I am replaying the input manually from the inspector. But my case is related to automated tests that are running with the Unity Test Framework. If run them from there - there is no input processed inside the game.
I’ve tried also many combinations of settings inside InputSystemUiInputModule. No results whatsoever.
Is there anything that I can try?
EDIT:
My complete use-case is like this:
- I am entering the playmode and playing the level with recording the user input.
- I am saving the inputtrace to the file and quitting the playmode
- Then I am running the UnityTest that will load the same scene, feed the inputtrace to the recorder, and play it back.
It is not working for me at the moment. I am seeing that some parts of the game that highlights something works just fine (getting the mouse pointer position on update), but no clicks are being recognized on InputTrigger and UI unless I click in the gameview to focus it.
@Rene-Damm - could you please take a look?
2 Likes
Hey have you found anything since? Im having the exact same use case!
unfortunately not. I abandoned this idea.