I must be retarded or something. I want a vector from one object to another. When object a is on the origin it works great. But the farther it gets from the origin the more inaccurate the direction vector gets. What am I doing wrong?
Here’s my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class vectorshit : MonoBehaviour {
public Transform other;
public Vector3 direction;
private void OnDrawGizmos()
{
direction = other.position - transform.position;
//direction.Normalize();
Gizmos.color = Color.red;
Gizmos.DrawLine(transform.position, direction);
}
}
Screens, first is offset, second is at origin