Now the CFrame.new(Position : Vector3, LookAt : Vector3) overload is actually deprecated and shouldn’t be really be used. Instead I recommend the use of CFrame.fromMatrix, this takes a rightVector and a upVector which then it’ll create a LookVector via these two provided Vectors.
You can learn more about it here, it provides a function that you can use.
I’ve tried to use some source code from that and ended up with this:
function lookAt(target, eye)
local forwardVector = (eye - target).Unit
local upVector = Vector3.new(0, 1, 0)
local rightVector = forwardVector:Cross(upVector)
local upVector2 = rightVector:Cross(forwardVector)
return CFrame.fromMatrix(eye, rightVector, upVector2)
end
item.Parent:SetPrimaryPartCFrame(lookAt(lookvector, item.Position))
However, still does not rotate in the direction.
If this helps:
I apply a Velocity (Directly to the primarypart without use of body movers)
I also use a BodyForce (which i use to add an anti-gravity to the part)
This is a technical mistake. It was deprecated because we intended to add a CFrame.new(Position: Vector3, LookAt: Vector3, [UpDirection: Vector3]) overload to CFrame.new, which lets you explicitly specify the up direction, but that got put on the back burner and forgotten about.
Re-implementing it yourself when you need a use case of exactly that is error-prone and a waste of time, please continue using CFrame.new(at, lookta), as the new variant is on it’s way down the pipe now.