'Curving' a vectorforce

So I’m making this F-35 jet for a war game.
I use one vector force at the engine to make the jet throttle up and down.
There’s one issue, when I roll the jet in flight, then pull up (basically go sideways) the jet orientates to the desired orientation, but the direction of the jet is still wrong. I made a drawing of this.


I think you understand what I mean, if not watch this gif.
You can see on the last part of the gif that the jet moves sideways, but the jet is pointed forward.

Is there anything I can do to sort of limit the curve of a vector force?

2 Likes

It looks like you’re not adding the rotational changes to the vector force, i.e. if a plane attempted to turn it would need to do so using some mechanism which applied force to its system, usually flaps. The directional velocity of the plane would then be affected. That’s the best guess I can give you without actually seeing how you’re applying the forces to the object, and how you’re updating that with the user’s input.

The plane’s force is turning eventually, but it takes a long time.
This is how I update the force.
image
And yes, I’m 100% certain that coroutine is running.

1 Like

I’m assuming the “ThrottlePercentage” value is changed based on a user clicking some key, e.g. ‘w’? The plane’s rotation being dependent on the mouse position?

If so, the problem is that you’re only applying the force in a world space direction. It needs to be relative to the object and it’s direction. i.e.:

EngineVectorForce.Force = Plane.PrimaryPart.CFrame.lookVector * Thrust

where Plane is the model of the plane, and PrimaryPart is a part within the plane with a Front face that’s in the same orientation as the plane’s desired travelling position (defined as the Plane model’s PrimaryPart property).

The plane’s throttle is decided by percentage, which is set by 2 keys, yes.
The plane’s orientation i set by Q & E, That moves an anchored and unwelded part which the bodygyro of the plane’s fuselage is cframed to each ‘heartbeat’.

Implementing the code above should work then :slight_smile:

Nope, doesn’t work.

1 Like

Can you show your code after implementation? Difficult to help you without understanding what you’ve changed

image
You can also click this text to see what I mean
image

1 Like

The issue is that you’re multiplying it with a vector. Look at my code again, it’s multiplying the vector by the thrust:

EngineVectorForce.Force = F36.Fuselage.CFrame.lookVector * Thrust