How do you move one gameobject in the direction of another gameobject? I don’t want to use unity’s built in api funcitons. I’m trying to think in terms of vector math that might be involved here.
void FixedUpdate()
{
// Calculate direction vector
Vector3 dir = obj1.transfom.position - ob2.transform.position;
// Normalize resultant vector to unit Vector
dir = dir.normalized;
// Move in the direction of the direction vector every frame
obj1.transform.position += dir * Time.deltaTme * speed;
}