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

Unexpected result with BodyGyros?

Asked by 7 years ago

I'm currently developing a script that would allow the player to walk on the wall, inside its inner workings I use a BodyGyro which is responsible for turning the player when they move on the wall. The only way I am aware of how to do this is shown below

Gyro = Instance.new("BodyGyro")
Gyro.Parent = Torso
Gyro.D = 50
Gyro.maxTorque = Vector3.new(0, 0, 0)

--This is how I change the rotation
Gyro.CFrame = Gyro.CFrame * CFrame.Angles(0,-.025,0)

However I've noticed a problem that I am rather surprised to see, I assume it's because I am multiplying the CFrame, but when I keep spinning it starts to spin faster and faster. I'm wondering if there is any way to prevent this from happening and ensure that the Gryo's CFrame Angle of X would always change by a solid rate.

Answer this question