local x, y, z = cv.DesiredPitch, 0, cv.DesiredRoll cv.DesiredCF = cv.face.CFrame * CFrame.Angles( ((cv.flight and math.rad(6)) or 0) + cv.PitchAngle , cv.YawAngle, cv.Angle) * CFrame.Angles(x, y, z)
cv.DesiredPitch and cv.DesiredRoll are an angle value. This is increased or decreased by user input.
cv.DesiredCF is used to align the cart to the orientation we want.
The way it works is it aligns itself facing a cframe called cv.face which is directly in the direction of the road.
Then we multiply by angles to make it face a certain way.
PitchAngle is the pitch… yaw angle makes the car turn sideways. cv.Angle makes the car roll so that it is inline with it. I GOT THIS COVERED.
Now we multiple by other angles.
These angles are meant to control the orientation of the cart in mid-air.
the problem is that. Because the first value is cv.face.CFrame then it’s going to be relative to THAT rather than what the cart is currently facing.
So I want to be able to have the cart perform backflips and rolls RELATIVE TO ITS OWN ORIENTATION.
Currently. If I roll the car 90 degrees to the left and then I attempt to do a backflip, the cart will instead turn sideways.
This is tricky as hell.
What I want are values for X, Y and Z that can make the cart face according to the orientation desired by DesiredPitch and DesiredRoll.