private void Convey(ConveyorSystem system, ConveyorComponent comp, float frameTime) { // Use an event for conveyors to know what needs to run if (!system.CanRun(comp)) { return; } var direction = system.GetAngle(comp).ToVec(); var entMan = IoCManager.Resolve <IEntityManager>(); var ownerPos = entMan.GetComponent <TransformComponent>(comp.Owner).WorldPosition; foreach (var(entity, physics) in EntitySystem.Get <ConveyorSystem>().GetEntitiesToMove(comp)) { var itemRelativeToConveyor = entMan.GetComponent <TransformComponent>(entity).WorldPosition - ownerPos; physics.LinearVelocity += Convey(direction, comp.Speed, frameTime, itemRelativeToConveyor); } }