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

How could I make a part face another part?

So I've been trying to make a part face a different, moving part, for example making a turret to rotate and follow a player, I heard of the AlignOrientation constraint and thought it might be possible to execute it with it but it doesnt seem like thats the case, anyone could offer me alternatives/tell me how it could be done with AlignOrientation? thanks.

1 comment

0

part.CFrame = CFrame.new(part.Position, part2.Position)

1 answer

AlignOrientation makes the first part want to have the same rotation as the second part, so you cant use that, if i were to do that i would put a BodyGyro in the looking part and put the following into a loop

script.Parent.BodyGyro.CFrame = CFrame.new(script.Parent, part2)

im not exactly sure what the rest of the settings should be, but MaxForce should never have the yaw and pitch axes set to zero, or else the BodyGyro wont be able to rotate in some axes

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