Hello everyone, I’m trying to make a plane and I am having some issues.
Firstly, I cannot go up and right at the same time. I think its probably because im using the same bodyangularvelocity to go up/down and right/left.
Secondly, when I go up or down, when im facing some ways, it works well, but other times, it rotates differently.(https://gyazo.com/143844e660260c84a76a76ef4fd8dc98)
And finally, another issue is that while im turning, the more time i hold the key to turn, the faster the plane turns until I release the key.
This is the script:
local part = script.Parent.Parent.Main
local event = script.Parent.Plane
local going
event.OnServerEvent:Connect(function(plr, running)
if running == true then
print("Moving")
going = true
local i = Instance.new("BodyVelocity")
local c = Instance.new("BodyAngularVelocity")
c.Parent = part
i.Parent = part
i.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
elseif running == false then
print("Not moving")
going = false
part.BodyVelocity:Destroy()
part.BodyAngularVelocity:Destroy()
end
end)
local seat = script.Parent
SteerSpeed = 1200
seat.Changed:Connect(function(p)
if p == "SteerFloat"then
local s = script.Parent.Parent.Main.BodyAngularVelocity
local bv = script.Parent.Parent.Main.BodyVelocity
while wait(0.1) and going == true do
s.AngularVelocity = Vector3.new(0,-SteerSpeed*seat.SteerFloat,0)
bv.Velocity = script.Parent.Parent.Main.CFrame.LookVector * 150
end
end
end)
ThrottleSpeed = 850
seat.Changed:Connect(function(p)
if p == "ThrottleFloat"then
local s = script.Parent.Parent.Main.BodyAngularVelocity
while wait(0.1) and going == true do
s.AngularVelocity = Vector3.new(0,0,-ThrottleSpeed*seat.ThrottleFloat)
end
end
end)
If you have any sugestions of other ways to make a WASD plane then pls tell them. Thanks for reading.