Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How could I make a part face another part?

Asked by
iOwn_You 543 Moderation Voter
5 years ago

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.

0
part.CFrame = CFrame.new(part.Position, part2.Position) DeceptiveCaster 3761 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

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

Ad

Answer this question