local x, y, z = 0, 0, 0 if cv.injump then -- print("We are rolling! ") -- if my cart is rolled to the side by 45 degrees. -- if my desired pitch is 45 degrees. -- then -- y should point slightly to the right, -- x should point slightly up, -- z should point slightly to the side yknow. x,y,z = cv.DesiredPitch, 0, cv.DesiredRoll warn("Pitch, ", math.deg(x), " Roll, ",math.deg(z)) -- x and z have components that should be used to adjust y, -- this will let the cart perform better stunts and backflips. end if cv.AddVelX.Magnitude > 1 and prevface then cv.face = prevface end 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)
This is for my game downhill rush.
What the game is meant to do is, players can perform jumps if they go on ramps.
if they are in a jump then therei s a button that lets them increase or decrease the DesiredPitch and DesiredRoll
The problem is that if I roll my cart 90 degrees and try to pitch upwards the car starts yawing sideways as it is not supposed to.
What is intended is
When the cart is rolled 90 degrees then me pitching up should cause the ‘y’ variable to be changed.
When the cart is pitched up by 90 degrees then me trying to roll the cart should cause the ‘y’ variable to be changed too idk