How to manually trigger an InputAction asset action ?

Hello,

I’d like to write functional tests using Unity test framework in order to validate specific gameplay situations. In order to achieve that I need to be able to manipulate a character which is already controlled using the new Unity Input System. Is it possible to manually, meaning from code, to set an action value and state ?

Thanks

Hi,

I haven’t tried to test things like that, but just an idea: maybe you can write your tests like input tests, described here.
You only feed real objects into them instead of fixtures and use the Press and other methods? I don’t know if they work though. If you use PlayerInput component, it is described there how to set it up for testing.

Again, I’m not sure if this works as you’d like, never done it myself.

1 Like