Open Leprawel opened 3 years ago
Yes, it's very inconvenient. I wrote a simple script that will help
[ExecuteInEditMode]
[RequireComponent(typeof(PathCreator))]
public class PathPoints : MonoBehaviour
{
public bool active;
public int index;
public Vector3 position;
private PathCreator _pathCreator;
private int _lastIndex = -1;
private void Awake()
{
_pathCreator = GetComponent<PathCreator>();
}
private void Update()
{
if (!active)
{
return;
}
if (index >= _pathCreator.bezierPath.NumPoints)
{
index = _pathCreator.bezierPath.NumPoints - 1;
}
if (index < 0)
{
index = 0;
}
if (_lastIndex != index)
{
position = _pathCreator.bezierPath.GetPoint(index);
_lastIndex = index;
}
_pathCreator.bezierPath.MovePoint(index, position);
}
}
I cant figure out how to do it, if Its possible. Having to move stuff by dragging points around with a mouse is not precise enough, I would like to input the position from keyboard.