Skip to content

Instantly share code, notes, and snippets.

@v0xel1337
Created April 11, 2024 17:06
Show Gist options
  • Save v0xel1337/c755cedcb6c3a325bb8e73a686aa2576 to your computer and use it in GitHub Desktop.
Save v0xel1337/c755cedcb6c3a325bb8e73a686aa2576 to your computer and use it in GitHub Desktop.
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