Hello, I got this problem. I wanna make a laser from object to center of the scene, and if the object moves, the laser also moves. I wrote a code:
private LineRenderer laser;
void Start () {
laser = GetComponent<LineRenderer>();
}
void Update () {
laser.SetPosition(1, - transform.position);
laser.SetPosition(0, Vector3.zero);
}
and this laser goes in right direction, but too far:
How can I fix it?