Copy movement of another object as Vector3

Hey there,

I’m looking to get the destination of an object as a vector3, if it were to mimic the movement of another.

If object A goes from Vector3 startA to Vector3 destinationA, how can I get Vector3 destinationB if object B were to move in the same direction defined by startA/destinationA, at a different transform position.

Man I’m bad at speaking my thoughts, sorry english is my second language :frowning:

7501034--924155--upload_2021-9-16_15-35-35.png

if I have the heading, distance, and direction between the first two points, how do I properly apply that to the second object to get the destination Vector3?

Vector3 heading = destination - start;
float distance = heading.magnitude;
Vector3 direction = heading / distance;

destinationB = startB + (destinationA - startA)

I previously tried startB + heading, but perhaps this is a weird parent interaction interfering.

I will do more testing and get back.

If there are parents involved, make sure you pay attention to whether you are using global positions or local positions.

Yep, this is what happened. I’m very frustrated this was the cause as I spent over an hour on this and had the correct answer in the first place… sort of :frowning:

Thanks for your help!