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

Is there a property of CFrame that gives the component of the X,Y,Z angles instead of coordinates?

Asked by 5 years ago

There are two buttons that control the plane direction:

Go Up:

engine.BodyGyro.CFrame = CFrame.Angles(math.rad(2+config.n.Value), engine.BodyGyro.CFrame.Y, engine.BodyGyro.CFrame.Z)

Go Left:

engine.BodyGyro.CFrame = CFrame.Angles(engine.BodyGyro.CFrame.X, math.rad(2+config.m.Value), engine.BodyGyro.CFrame.Z)

When pressing one button, it works well so the plane doesn't shake. However when pressing both buttons , they play a "tug-of-war" which causes the plane to shake and go unbalanced.

I tried to use the property of CFrame ****X, Y and ,Z**** to keep the X, Y, or Z angles the same when the button is only controlling one part of it but they can only be used for coordinates.

Are there any alternatives to this?

Thanks Psvita65594

0
you can subtract the position and get a cframe with with only the rotation matrix. `(local rot = cf - cf.Position)` EpicMetatableMoment 1444 — 5y

Answer this question