Am I missing something with CFrame.lookAt()?

Hi all, I’ve been trying to get CFrame.lookAt() to work using some tutorials, but I can’t.
Is there anything wrong with the code? The script compiler doesn’t say anything with errors, nor does the output, but the lookPart still doesn’t look at the other part (part).

local lookPart = script.Parent
local part = workspace.Part

while true do 
	local lookAt = lookPart.CFrame:PointToWorldSpace(Vector3.new(0,0,-3)):Lerp(part.Position,.1)
	
	lookPart.CFrame = CFrame.lookAt(lookPart.Position, lookAt, lookPart.CFrame.UpVector)
	wait(0)
	
end

what do I do? I’ve been stuck on this all morning? Please help.

4 Likes

I just tested it on an empty baseplate and it works perfectly fine, theres might be another Part somewhere else in the workspace that is interfering

3 Likes

Interesting, so I guess it was a Surface material issue, I had a hinge on a part to denote the front side of it and that didn’t work, but when you get fresh parts, it will.

1 Like

they removed surfaces recently so i guess that is causing some weird behavior

2 Likes