Hi there. I have a helicopter that is supposed to hover. This is how it supposed to work. When I press Q it goes down, when I press E then it should go up, and when I release the key it should hover.
This is what happens:
Every thing in the helicopter except the forward and steer block are set to massless.
game:GetService("ReplicatedStorage").MoveHeli2.OnServerEvent:Connect(function(player, input)
local mass = script.Parent.Parent.Steer:GetMass()
for i, v in pairs(player.Character:GetChildren()) do
if v:IsA("BasePart") or v:IsA("MeshPart") then
mass = mass + v:GetMass()
end
end
wait()
if input == "Q" then
script.Parent.Parent.Steer.Up1.Force = Vector3.new(workspace.Gravity / mass, 0, 0)
script.Parent.Parent.Forward.Up.Force = Vector3.new(workspace.Gravity / mass, 0, 0)
end
if input == "E" then
script.Parent.Parent.Steer.Up1.Force = Vector3.new(workspace.Gravity * mass * 1.1, 0, 0)
script.Parent.Parent.Forward.Up.Force = Vector3.new(workspace.Gravity * mass * 1.1, 0, 0)
end
if input == "Stop" then
print("hi")
script.Parent.Parent.Steer.Up1.Force = Vector3.new(workspace.Gravity * mass, 0, 0)
script.Parent.Parent.Forward.Up.Force = Vector3.new(workspace.Gravity * mass, 0, 0)
end
end)