1
Fork 0
mirror of https://github.com/Steffo99/bleach-beach.git synced 2024-12-04 19:04:19 +00:00
bleach-beach/Assets/Scripts/Linker.cs
2018-08-12 13:09:12 +02:00

23 lines
568 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Linker : MonoBehaviour
{
public GameObject firstObject;
public GameObject secondObject;
private LineRenderer lineRenderer;
void Start()
{
lineRenderer = GetComponent<LineRenderer>();
}
void Update () {
if (firstObject != null && secondObject != null)
{
lineRenderer.SetPosition(0, firstObject.transform.position);
lineRenderer.SetPosition(1, secondObject.transform.position);
}
}
}