so i made a plane but im having problems where i cant turn it like a plane instead it turns like a car cuz a real plane should turn like this:
robloxapp-20210828-1814558.wmv (2.0 MB)
this red plane is a free model so not mine
but my plane sadly turn like this and the plane doesnt fall when i put thottle to zero :
robloxapp-20210828-1820495.wmv (3.3 MB)
here is my very messy code (dont judge pls):
the plane code is local btw
local Uis = game:GetService("UserInputService")
local plane = script.Plane.Value
local inc = 1
local forward = false
local backward = false
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local mouse = player:GetMouse()
Uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.W then
forward = true
elseif input.KeyCode == Enum.KeyCode.S then
backward = true
end
end)
Uis.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.W then
forward = false
elseif input.KeyCode == Enum.KeyCode.S then
backward = false
end
end)
local function makeBodyGyroFaceMouse()
local direction = mouse.Hit.Position - plane.CFrame.Position
--bodyGyro.CFrame = getRotationBetween(bodyGyro.CFrame.LookVector,direction.Unit)*bodyGyro.CFrame
plane.BodyGyro.CFrame = CFrame.lookAt(plane.CFrame.Position,mouse.Hit.Position)
--debugging body gyro orientation purposes
--part.CFrame = CFrame.new(humanoid.RootPart.Position+Vector3.new(0,10,0))*(bodyGyro.CFrame-bodyGyro.CFrame.Position)
end
game:GetService("RunService").RenderStepped:Connect(function()
makeBodyGyroFaceMouse()
if forward == true then
script.ScreenGui.Fill.Throttle.Value += 1
else
script.ScreenGui.Fill.Throttle.Value = script.ScreenGui.Fill.Throttle.Value
end
if backward == true then
script.ScreenGui.Fill.Throttle.Value -= 1
else
script.ScreenGui.Fill.Throttle.Value = script.ScreenGui.Fill.Throttle.Value
end
local zerotooneval = script.ScreenGui.Fill.Throttle.Value/100
script.ScreenGui.Fill.TextButton.Position = UDim2.new(.5,0,zerotooneval,0)
local plspeed = math.sqrt((plane.Velocity.x)^2+(plane.Velocity.y)^2+(plane.Velocity.z)^2)
script.ScreenGui.Speed.Text = "Speed:"..plspeed
plane.BodyVelocity.Velocity = plane.CFrame.LookVector*script.ScreenGui.Fill.Throttle.Value
end)
thx for any help