Hello, so i’ve been making this plane for a few days now using body movers which i want to keep using as it is more practical than vector forces for what i’m trying to achieve. Everything is pretty much going well except the fact that the landing gears suddenly decide to clip through the ground when landing.
So as you can see, while taxiing and taking off, the landing gears don’t seem to have any clipping issue with the ground
https://i.gyazo.com/b6b127d430a7538a48467436179a6d86.mp4
https://i.gyazo.com/e526971749431984af9687899c937812.mp4
However, as soon as the landing is even slightly too strong (basically anything below -3 studs/s on the world Y axis), the landing gears will clip through the ground like 80% of the time, here are two different landing attempts:
https://i.gyazo.com/aea2be7eff7b5f281c25e8087182289b.mp4
https://i.gyazo.com/7c79850fc084c2db21e53a1122da08e5.mp4
And also here is a screenshot of what the landing gears collisions are (basically the collision hitbox is an invisible sphere around the landing gear): https://gyazo.com/5c3c793aa1a9a5c8244fc576e823af94
Until now what i’ve tried to do is a script that checks if the plane is taxiing or not and changes the BodyForce’s MaxForce value based on that (as i originally thought the reason why it clipped would be the fact that the MaxForce was too high)
Here’s the code that updates the MaxForce based on the taxi status:
while plane ~= nil and plane.Parent ~= nil and plane:FindFirstChild("Cockpit") and plane.Cockpit.Health.Value > 0 do
taxi = false
local gearBoxes = {}
for _, gear in pairs(plane.Gears:GetDescendants()) do
if gear.Name == "Hitbox" then
table.insert(gearBoxes, gear)
end
end
local rayParam = RaycastParams.new()
rayParam.FilterType = Enum.RaycastFilterType.Blacklist
rayParam.FilterDescendantsInstances = {plane}
if gearsOut.Value == true then
for _, gear in pairs(gearBoxes) do
local rayResult = workspace:Raycast(plane.Gears.ControlGear.Hitbox.Position, Vector3.new(0,-4,0), rayParam)
if rayResult then
taxi = true
break
end
end
end
if taxi == false then
bodyVelocity.MaxForce = Vector3.new(mass*workspace.Gravity*1.3, mass*workspace.Gravity*1.3, mass*workspace.Gravity*1.3)
else
local rayResult = workspace:Raycast(plane.Gears.ControlGear.Hitbox.Position, Vector3.new(0,-2,0), rayParam)
if rayResult then
bodyVelocity.MaxForce = Vector3.new(mass*workspace.Gravity*.9, mass*workspace.Gravity*.9, mass*workspace.Gravity*.9)
else
bodyVelocity.MaxForce = Vector3.new(mass*workspace.Gravity*1.1, mass*workspace.Gravity*1.1, mass*workspace.Gravity*1.1)
end
end
task.wait()
end
After testing multiple times with a lot of different values, i realised that it does help just a bit but not enough for the problem to be solved at all. What really seems to be the weirdest thing to me is the fact that it specifically only happens on landing and not while taxiing (and yet more downward forces are applied on the plane while taxiing than when flying or barely landing, which shouldn’t be making sense…?)
Notes : The CanCollide property of the landing gears is NEVER set to false, so it cannot be because of that ; the NetworkOwnership of the entire plane model is set to the client (so i thought maybe it could be because of a delay between the client/server too…? i’m not too sure if that would be possible in this case)
I cannot find any other solutions or work-around after 2 days of trying and failing, which is the reason why i am posting this.
So, is there any way i could prevent my landing gears from clipping through the ground?
Sorry if some of the explanations are too vague let me know if there is something that i haven’t explained in an understandable manner