My vector force is slowly moving chopper up

https://gyazo.com/f0292e7bfedb6cd370e555fc4b3e5abb
So i am trying to make chopper system.
But
It seems like when I get the mass, the chopper goes up and up.
This is code:

local function GetTotalMass()
	local mass = 0
	for i,v in pairs(workspace.Helicopter:GetChildren()) do
		if v.Massless then
			return
		end
		mass = mass + v:GetMass()
	end
	print('Good! Chopper mass: '..mass)
	print("Let's get character mass..")
	for i,v in pairs(game.Players.LocalPlayer.Character:GetDescendants()) do
		if (v:IsA('BasePart')) or v:IsA('UnionOperation') or v:IsA('MeshPart') then
		if (v.Massless) then
			return
		end
		mass = mass + v:GetMass()
		end
		end
	print("Good, now, multiply by gravity, and return.")
	print("Total mass = "..mass * workspace.Gravity)
	return mass * workspace.Gravity
end

local TotalMass = GetTotalMass()


Force = Vector3.new(1,TotalMass,1)

it should stay stable :thinking:

Maybe that is the problem
Try this:

mass=v:GetMass()

Well, he’s trying to get the total mass so mass = mass + v:GetMass() is fine

1 Like

I’m sure this isn’t your problem, but there are some problems here. First, v.Massless is going to error if Massless doesn’t exist, at least last time I was on the platform. In addition, return will actually stop the function altogether. You should use
if v:FindFirstChild("Massless") then mass += v:GetMass() end

No, :FindFirstChild() works on childs not propeties

1 Like

Massless is a property, :FindFirstChild() wont work

1 Like

Oops. That wasn’t there when I left.

Still is not trouble.
It’s not about that

1 Like

I think I have a theory, here you have found the force required to balance the chopper against gravity. It may be going up because of slight errors in the mass. You may need to add more force to make it ascend faster.
Wait, you are applying the vector force here right?

1 Like

Also the shorthand operator += doesn’t exist in lua :slight_smile:

Yes it does exist in Luau it was added

1 Like

Really?! And all this time I was doing it in that tedious way.
Also did adding more force work?

1 Like

Nope, I will reduce
Eeeeeee30chars

1 Like

Now look here, I can only be so wrong in one thread.

Really sorry, you said you had left roblox, so assuming you’re learning other languages, I thought maybe it had you mixed up. Also i really did not know these existed. (they’re amazing, thank you @varjoy for telling me)

1 Like

In my opinion, a helicopter going straight and only straight is sorta unrealistic