Get the distance from obj_1 to obj_2 with offset

Basically this:

I tried this but when I use moveto with idealDistance on my humanoid, the character just passes through.

local idealN = 3
local idealDistance = ncPrimaryPart.CFrame * CFrame.lookAt(ncPrimaryPart.Position, primaryPart.Position).LookVector * idealN
1 Like

So your trying too find 3 studs in front of object 1?

I’m pretty sure that would be

local obj = obj.Position
local vec3 = obj.Position + obj.CFrame.LookVector * 3

I think you just calculated the vec3 in front of the obj. I need it to be in my direction.

So the vector3 thats 3 studs in front of the other object relative to you?

1 Like

What exactly are you trying to make with this, you could potentially try another solution

Sorry for the late reply, yes, you are correct.

No, this is exactly what I’m looking for.

local idealN = 3
local idealDistance = ncPrimaryPart.CFrame + CFrame.lookAt(ncPrimaryPart.Position, primaryPart.Position).LookVector * idealN

This is the solution, I figured it out.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.