Create a detector component.
Detection radius in world units
Only detect entities on these collision layers
Maximum results to track (default: 32)
Component object suitable for spreading into spawn()
ecs.spawn({ ...createDetector(300, ['enemy']), ...createLocalTransform(400, 400),}); Copy
ecs.spawn({ ...createDetector(300, ['enemy']), ...createLocalTransform(400, 400),});
Create a detector component.