quality-control/Assets/Scripts/LineAttachEnd.cs

23 lines
478 B
C#
Raw Permalink Normal View History

2024-08-18 14:32:52 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LineAttachEnd : MonoBehaviour
{
public Transform anchor;
LineRenderer _line;
LineRenderer line { get { if (!_line) _line = GetComponent<LineRenderer>(); return _line; } }
private void Start()
{
line.useWorldSpace = true;
}
void Update()
{
line.SetPosition(0, transform.position);
line.SetPosition(1, anchor.position);
}
}