Hi, I’m struggling with Uinty DOTS and Physics, I made a controlled player that is subject to physics, the problem is that the capsule’s collider doesn’t move while the 3D model responds very well to physics as well as to my inputs…
[BurstCompile]
public void OnUpdate(ref SystemState state)
{
foreach (var (playerComponents, localTransform, physicsVelocity) in SystemAPI.Query<RefRO<PlayerComponents>, RefRO<LocalTransform>, RefRW<PhysicsVelocity>>())
{
ref readonly PlayerComponents data = ref playerComponents.ValueRO;
ref readonly LocalTransform transform = ref localTransform.ValueRO;
ref PhysicsVelocity vel = ref physicsVelocity.ValueRW;
float x = Input.GetAxis("Horizontal");
float z = Input.GetAxis("Vertical");
float3 move = (transform.Right() * x + transform.Forward() * z) * data.walkSpeed;
move.y = vel.Linear.y;
vel.Linear = move;
}
}