I need these forces to act together to make the part rotate up at a fixed angle and continually rotate right forever.
the following lines are both in a while loop:
script.Parent.BodyGyro.cframe = script.Parent.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0, -.05, 0)
–Continually rotate part
in another script:
script.Parent.BodyGyro.CFrame = cframe.fromEulerAnglesXYZ(0.05,–what goes here to keep the Y above?, 0)
–rotate X axis to make part face up, how to keep the other Y axis rotation so it doesn’t collide forces?
I use CFrame.Angle and math.rad() for rotation. This way i can write an angle in degrees which is a lot easier than using radians.
I would however recommend you look into the
new body movers.
New Body Movers for more details about the new objects.
The original post describes the Body Movers API. This is about how to create them in Studio. Five new entries have been added to the Create menu in the Constraint group on the Model tab:
AlignOrientation, AlignPosition and LineForce require two clicks on two parts. It will create the mover together with the two associated attachments (first click for attachment0 and second click for attachment1). The principal axis of the a…
If you mess around with these you will likely find a combination that works for whatever you’d trying to do.
If you really want to use BodyGyros, then it will get a bit more complicated:
Ideally, you would use one BodyGyro that is moving as if it’s being affected by 2 forces. Controlling them from one place is the easiest way to go about this.
-- x and y rotation calculated together.
script.Parent.BodyGyro.cframe = script.Parent.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(.05, -.05, 0)
If you really want to use two scripts, I can point you towards math.atan2, which is how you can calculate a single axis from a CFrame like you want to.
You will need to understand basic trigonometry and cframes to really do this though.
Here is an explanation that you can look into if you want to follow this route: