Make a plane using VectorForce

So I want to make my plane fly using VectorForce but I don’t know how to properly make it. It goes to fast.

local speed = 30

local function getModelMass()
	local mass = 0
	for i,v in ipairs(plane:GetDescendants()) do
		if v:IsA("BasePart") then
			mass += v.AssemblyMass
		end
	end
	return mass
end

local mass = getModelMass()
local force = (mass * FlyPart.CFrame.LookVector * speed)
VectorForce.Force = force

6 Likes

Have you tried turning down the speed?

Yes, but that would make the plane unable to fly.

Even lowering by like 1 would make it unable to fly?

1 Like

Is it because its in a loop?

RunService.Heartbeat:Connect(function(delta)
	if isOn.Value == true then
		--FlyPart.AssemblyLinearVelocity = FlyPart.CFrame.LookVector * speed.Value
		local mass = getModelMass()
		local force = (mass * FlyPart.CFrame.LookVector * speed.Value)
		VectorForce.Force = force
	end
end)
1 Like

You can try printing out the force to see if it is changing at all.

It prints out large numbers like in the ten thousands.

1 Like

Do the numbers keep growing or stay around one value?

They keep growing.

image

Well actually since its multiplying by the lookvector that would make since that its changing.

You can try dividing the force by 2 before putting it in the vectorforce

local mass = getModelMass()
local force = (mass * FlyPart.CFrame.LookVector * speed.Value) / 2
print(force)
VectorForce.Force = force

The controlling is harder with VectorForce. Should I use something else than VectorForce?

Another option you could try is using velocity.

How can I make the plane go down when going at a low speed?

I tried doing:

local downVelocity = -speed / 10

But that would make it go down fast if the plane goes faster.

Try multiplying it instead of dividing, multiply it with a value between 0 and 1.

Doesn’t seem to work.

local downForceVelocity = -speed.Value * 0.5
FlyPart.AssemblyLinearVelocity = Vector3.new(FlyPart.AssemblyLinearVelocity.X, downForceVelocity, FlyPart.AssemblyLinearVelocity.Z)

Was it working before when you were dividing it, what changed when you multiplied it?

None of them worked. I don’t think anything changed.

Dose the plane go forward at least?

1 Like