BodyGyro inquiry

Hello,

Recently, I’ve been working on my very own spaceship. However, I’ve faced a common error.

ship

That error would be the BodyGyro I’ve been using to control the ship.

Here’s a quick example of how it turns and whatnot:

                local MPOS = MousePosition:InvokeClient(game.Players:GetPlayerFromCharacter(Ms.Occupant.Parent))
                Ms.BodyGyro.CFrame = CFrame.new(Ms.Position, MPOS)*CFrame.Angles(0,-3.14/2+1.6,Ms.RotVelocity.Y/2)

When I try to do a loop or do a nose dive, it will bug out and start to finick. Which can really negatively impact overall gameplay.

If someone could help me, that would be greatly appreciated.

Thank you,
MlLKBAG.

When you say it starts to ‘finick’ do you mean the ship starts to tilt erratically, or do you mean the camera doesn’t follow the ship and flips around?
I know that a VehicleSeat camera gets erratic when the seat gets close to vertical.

When I go into a full incline rather upwards or downwards, it begins to shake erratically.

-90/90 degree inclines are impossible, I’m guessing it’s how CFrame functions but it’s still very annoying.

Have you tried decreasing the BodyGyro | Roblox Creator Documentation in your BodyGyro?
That may be keeping you from tilting for inclines.

I have it set to math.Huge on all vectors, I believe it has to do with CFrame in general.

I see some games invert their camera when they turn upside-down. But I’m not sure how I would accomplish that either.

But if you have the BodyGyro set to math.Huge on all vectors it’s going to fight against anything that tries to tilt it.
Have you tried using a couple VectorForce | Roblox Creator Documentation s to control your movement and Torque for rotation?

I’m using the mouse to aim the aircraft (Setting a bodygyro to face the position of the player’s mouse).

Unfortunately, this limits turning capabilities.

I’ll try this, and I will get back to you notifying you if it works or not.

The problem you’re having is related to the up-vector. When you use CFrame.new(Vector3, Vector3), a deprecated constructor, it assumes that you’re using up (Vector3.new(0, 1, 0)) as the up-vector. CFrame.lookAt can let you use a select a different up-vector, but that’s probably not related to your problem. You’ll never be able to go up-side-down with those functions unless you mess with the up vector in some way.

2 Likes

Maybe CFrame.fromorientation somehow make it rotate towards the mouse’s position??