Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to use CFrame to point an object at another?

I just want to know how I can use CFrame to make a part point at another part. I tried to use this line of code I found on the wiki:

Workspace.Part.CFrame = CFrame.new(Workspace.Part.Position, Vector3.new(0, 75, 75))

But it doesn't really point at something, and more or less just angles the part in a really strange way that I can't explain. I've read through the CFrame article on the wiki to see if there were any other methods I could do, but nothing has worked so far.

1 answer

Never mind, figured it out after a bit more fidgeting. Instead of using the above code exactly, I did:

Workspace.Part.CFrame = CFrame.new(Workspace.Part.Position, Workspace.Part2.Position)

This will keep the part where it is while orienting its front face towards the designated part (Part2).

This discussion is preserved as it was. New answers, comments, and votes are closed.