NOTE: Only one distance module can be used at a time
Properties
Name
Data Type
Range
Millimeters
float
0 - 1800
Inches
float
0 - 70.8
Feet
float
0 - 5.9
What does the data mean?
The module can measure past 6ft, but the accuracy begins to diminish. The distance is from the top of the module to an object in front of it. The larger the object the better. Sunlight tends to create erroneous values due to the underlying method of detection.
What ports can I use it on?
3-6
Code
var distanceToObject = Magic.modules.distance.milimeters;
using Magic;
public class Demo : MonoBehaviour
{
// create a reference to the module
public Magic.Modules.DistanceModule distance;
void Start()
{
}
void Update()
{
// access the property of the module
float distanceToObject = distance.feet;
}
}