Hello. I made a pvp plane, I am trying to allow full 360 rotation for the plane.
When it happened in the past, I had to prevent them from spinning an entire 360 turn.
Basically, limited the turn to 1/4𝛑 radians. Although it prevented it, I still think this is necessary in my game. I am using BodyGyro to rotate the plane, and whenever the plane rotates 90 degrees up & down, it lags and disallows the plane to continue. Here is the code part that is handling plane rotation:
local center = Vector2.new(workspace.CurrentCamera.ViewportSize.X / 2, workspace.CurrentCamera.ViewportSize.Y / 2)
local x, y, z = plane.PrimaryPart.CFrame:ToOrientation();
bodyVelocity.Velocity = plane.PrimaryPart.CFrame.lookVector * 150
bodyVelocity.MaxForce = Vector3.new(40000, 40000, 40000)
bodyGyro.CFrame = CFrame.new(bodyGyro.CFrame.Position) * CFrame.fromOrientation(x + (-mouse.Y + center.Y) / (workspace.CurrentCamera.ViewportSize.Y / 1.25), y + (-mouse.X + center.X) / (workspace.CurrentCamera.ViewportSize.X / 1.25), z + (-mouse.X + center.X) / (workspace.CurrentCamera.ViewportSize.X / 1.25))