Magnet cables

This commit is contained in:
nothke
2024-08-18 16:32:52 +02:00
parent 2de1111cd0
commit 81ad6d6390
6 changed files with 732 additions and 252 deletions

View File

@@ -0,0 +1,22 @@
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);
}
}