How to Detect Obstacles Using Optical Sensors
Positioning Exterior and Inline Sensors
Optical Sensors safeguard your physics contraptions by scanning your route for obstacles. Mount standard Optical Sensors along the exterior of your craft facing forward or along hazardous blind spots. If your craft has a compact frame or cramped machinery bays, use the Inline Optical Sensor instead. The inline version provides a streamlined detection beam suited for tight vehicle spaces where standard sensor blocks cannot fit.
Configuring Distances and Block Filters
Optical Sensors use a raycasting beam to measure the distance to nearby blocks in real time. Set the sensor's detection distance to match your craft's stopping range, allowing enough lead time for evasion or automated braking.
You can also configure the Optical Sensor's block filter. Setting specific block types prevents the sensor from reacting to harmless elements while ensuring it triggers whenever hazardous terrain or specific structures cross the beam's path. Wire the sensor output to your thruster controls or connect it to ComputerCraft for automated vehicle monitoring and collision response.