Created
January 17, 2018 23:07
-
-
Save warrickct/4d438f09092fb8e59acfacb771fc0e66 to your computer and use it in GitHub Desktop.
Projects a laser from a Vive controller straight forward.
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
Quaternion or = controller.transform.rot; | |
Vector3 start = transform.TransformPoint(controller.transform.pos); | |
Vector3 end = start + ((or * Vector3.forward) * 5000.0f); | |
laser.enabled = true; | |
laser.SetPosition(0, start); | |
laser.SetPosition(1, end); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment