How to use the new InputSystem with DOTS/ECS?

I know DOTS is still experimental, but are there any examples out there on how to use the new inputsystem with DOTS/ECS?

Hi,

Here is how I do it for now :

  1. create a monobehavior implementing IConvertGameObjectToEntity
  2. create an “input forwarder” monobehavior
  3. grab a reference to the player entity during the convertion process (1.) and set it to the input forwarder (2.)
  4. in the input forwarder create a method taht read the user input and set a player input IComponentData on the player entity (3.)
  5. set it up in scene with a convert and inject for the gameobject that has the 2 monobehavior described above.

the official repo has an example https://github.com/Unity-Technologies/EntityComponentSystemSamples/blob/d616c1b077c306e6f31b41a3970799e4b132139b/UnityPhysicsSamples/Assets/Common/Scripts/DemoInputGatheringSystem.cs

1 Like

seems to not work on linux ubuntu 20