BodyForce plane's landing gears clipping through the ground on landing

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

1 Like

Might sound weird, I don’t have any good advice other than you could try to remake the system for the front landing gear, because from the videos it appears the back one has no problems. I could be wrong, just an idea.

have you tried making the invisible spheres visible so we can see what there doing as your landing

are the collision spheres just normal parts set the the ball shape?

how did you connect the spheres to the plane model?

Yes, they are normal parts set to ball shape, and they are held to the rest of the gear model with WeldConstraints, the gear’s holder itself is then attached to the wing with a Motor6D (as i made them retractable).

I tried making them visible to see what it would do as you said, it literally clips through the ground as expected, no other « anomalies » are there

If you weld the balls directly to the wing and not the gear does that change anything?

1 Like

I’m really confused about why but this literally fixed it, i can literally slam the landing gears on the ground and it doesn’t clip through the ground at all anymore since i welded it to the wings instead of the rest of the landing gear, i guess it’s an issue with the Motor6D? I think I’ll work around the issue that way it seems like not too difficult of a fix

If anyone reads this and knows about this kind of issue i’d really be interested to know why Motor6D creates this kind of behavior with collisions.

i guess this sums up what programming is ; i don’t know why it works this way but it works

1 Like

iv never really used motor6d before but i cant see why that will be the problem how about if you use HingeConstraint instead?

https://developer.roblox.com/en-us/api-reference/class/HingeConstraint

also as a side note you should be using the new body movers

this video i made will help you on how to use the new body movers

I just tried using HingeConstraints and it seems to be doing the work well too

I’ll check it out and i’ll see if i can have the same practical use with the new movers rather than with the old ones for what i’m trying to make, thanks for all the help.

You should use Motor6D’s, they are like hinges but less glitchy. They work a bit like hinges and welds.
image
Here are the properties if you were wondering.
(Sorry if I missed previous context about what you were using. I didn’t look through the whole thing, all I can say from previous experience is that they are way better in terms of physics that hinges if you’re a fan of things working rather than glitching. Also sorry if I assumed you didn’t know how to use them.)