LF PowerGrid
Logic & Sensors

Motion Sensor

Detects nearby players within 15m using raycast and gates power accordingly.

Loading Motion Sensor...

Overview

The Motion Sensor is a proximity-based gating device that detects nearby players within 15 meters using line-of-sight raycast checks. When a player is detected, the sensor opens its gate and allows power to flow downstream. When no players are present, the gate closes and blocks all power. Detect modes can be switched between ALL players, TEAM members only, or ENEMY players only, enabling sophisticated base automation that responds intelligently to different threat levels. Sensors can be paired together to create networked detection zones.

Specifications

Property Value
Type Passthrough (1 IN + 1 OUT) with gate
Detection Range 15 m
Detection Method Line-of-sight raycast
Detect Modes 0=ALL, 1=TEAM, 2=ENEMY
Power Consumption 5 u/s
Output Capacity 20 u/s
Gate Behavior Open on detection, closed when clear
Pairing Optional group network
Weight (placed) 800 g
Weight (kit) 600 g
Class Name LFPG_MotionSensor
Base Class LFPG_WireOwnerBase

How It Works

The Motion Sensor continuously scans a 15-meter radius around itself, checking for players using line-of-sight raycast checks. When the active detect mode finds a valid target within range, the sensor immediately opens its gate, allowing power to flow from input to output. As long as a player remains visible within detection range, the gate stays open. When all matching targets leave the detection area or line-of-sight is blocked, the gate closes and power is immediately cut.

The detect mode determines which players trigger the sensor: mode 0 (ALL) responds to any player, mode 1 (TEAM) only detects teammates, and mode 2 (ENEMY) only detects hostile players. This allows asymmetric automation where friendly visitors don't trigger alarms but actual threats do.

LED Indicator

  • Green: Player detected (gate open, power flowing)
  • Red: Powered but no detection (gate closed)
  • Off: No power available

Wiring Examples

Auto-Lighting on Entry

Battery
Motion Sensor (15m range)
Ceiling Light

Lights automatically activate when anyone approaches, providing hands-free illumination at base entrances.

Team-Only Gate Lock

Battery
Motion Sensor (mode=TEAM)
Door Controller

Set detect mode to TEAM. The door auto-unlocks when friendly players approach, stays locked for enemies.

Perimeter Alarm System

Battery
Motion Sensor (mode=ENEMY)
AND Gate (with Switch)
Speaker

Detects only hostile players. Combine with a manual switch to create an armed alarm that sounds only for enemies.

Tips

  • The raycast check means walls and obstacles block detection—position sensors with line-of-sight to entrances.
  • Use mode=TEAM for base-friendly automation and mode=ENEMY for security systems.
  • Pair multiple sensors together to cover large bases or create networked detection zones.
  • At 5 u/s consumption, motion sensors are power-efficient even when active 24/7.
  • Combine with Timer modules to delay reactions or extend gate-open duration beyond player proximity.
  • Test detect modes and range with different player proximity scenarios before deploying in combat.