Skip to content

Instantly share code, notes, and snippets.

@colormono
Last active October 9, 2018 19:19
Show Gist options
  • Select an option

  • Save colormono/401399e61214232755cfdaa7fd31d907 to your computer and use it in GitHub Desktop.

Select an option

Save colormono/401399e61214232755cfdaa7fd31d907 to your computer and use it in GitHub Desktop.
[LensStudio: CheckDistance] #LensStudio
// Check the distance between two objects
//@input SceneObject objectA
//@input SceneObject objectB
//@input float distCheck
var pointA = script.objectA.getTransform().getWorldPosition();
var pointB = script.objectB.getTransform().getWorldPosition();
var distance = pointA.distance(pointB);
if(distance > script.distCheck){
print("Lejos: " + distance);
} else {
print("Tocando.");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment