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

How can I get BodyGyro to rotate on just Y axis?

Asked by
Dominical 215 Moderation Voter
8 years ago

I am creating a part that faces you using a BodyGyro. I was wondering how I could get it to face you, but only using the Y axis, so the X and Z axes won't rotate. This is what I have:

part=workspace.Part
torso=workspace.Player.Torso
part.BodyGyro.cframe=CFrame.new(part.Position,part.Position+(part.Position-torso.Position).unit)

But that rotates it so the all the axes face you. Any help is appreciated. Thanks!

Answer this question