I would like to give a starting position and an end position and create a Vector3 that will point to the end position from the starting position.
I’m not very good at vector math, and can’t figure it out
I have tried creating a CFrame that points to the location and getting it’s LookVector, however that A. didn’t point in the right direction and B. the Y value was huge for some reason
A Vector3 does not have an orientation. If you mean that you would like to create a CFrame (which consists of both a translational and rotational component) centered at the starting position facing the target position, then the following snippet demonstrates a way to do this:
local eye = Vector3.new(0, 5, 0) -- starting position
local targetPosition = eye + Vector3.new(1, 1, 1) -- target position
local lookAtCFrame = CFrame.lookAt(eye, targetPosition)
A vector does have a direction though(From an origin point). You can multiply vectors by integers which I believe is what partly linear interpolation is.
You can interpolate the start position to the end position with the “Lerp” method and then make your part face the end position using the lookAt constructor shown.
I believe you don’t actually need to make a CFrame you can just minus the originvector by the endvector which will make the endvector relative to the originvector and from there on you can lerp.