Last active
October 9, 2018 19:19
-
-
Save colormono/401399e61214232755cfdaa7fd31d907 to your computer and use it in GitHub Desktop.
[LensStudio: CheckDistance] #LensStudio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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