# How Would I Orient A Part Based On Another Parts Position?

So, I’m trying to orient a part based on another parts location.
https://gyazo.com/a2003be5a4a538335c5c844800290da7 (this is what it roughly should look like)

Consider the sphere, the main object, the object that is being used to base the orientation of the other parts. The other objects are the ones that have been Oriented according to the sphere. One idea I have is welding invisible parts to the sphere and setting the other objects positions to the invisible parts, however, I’m not sure if there’s a more efficient way using an algorithm?

1 Like

I think you can just have a cylinder welded to the parts and then just rotate the cylinder, which is basically your idea. Another way is only, only if all the parts are equally spaced, group them, then rotate the whole model

1 Like

I believe you could just use some simple CFrame logic and create a look at(face towards) function like this:

``````function LookAt(MainPart, Parts)
for i,v in pairs(Parts) do
v.CFrame = CFrame.new(v.Position, MainPart.Position)
end
end
``````

Similar to what is Seen Here (without the function and stuff):

2 Likes