Skip to content

Instantly share code, notes, and snippets.

@michidk
Created January 18, 2017 21:27
Show Gist options
  • Save michidk/0d74698d433a32863aeb0d9e802bf1fa to your computer and use it in GitHub Desktop.
Save michidk/0d74698d433a32863aeb0d9e802bf1fa to your computer and use it in GitHub Desktop.
LineRendererObjectLine
namespace Default
{
[RequireComponent(typeof(LineRenderer))]
public class LineRendererObjectLine : MonoBehaviour
{
public GameObject[] GameOjects;
private LineRenderer lineRenderer;
void Awake()
{
this.lineRenderer = GetComponent<LineRenderer>();
}
void Update()
{
for (int i = 0; i < GameOjects.Length; i++)
{
lineRenderer.SetPosition(i, GameOjects[i].transform.position);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment