Created
April 11, 2024 17:06
-
-
Save v0xel1337/c755cedcb6c3a325bb8e73a686aa2576 to your computer and use it in GitHub Desktop.
This file contains 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
if (Physics.Raycast(transform.position, transform.forward, out hit)) | |
{ | |
if (hit.collider) | |
{ | |
lr.SetPosition(1, new Vector3(0,0,hit.distance)); | |
} | |
} | |
else | |
lr.SetPosition(1, new Vector3(0,0,10)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment