Jump to content

Landing Leg Problems


Recommended Posts

Gah!

I though I finally had solved how to make this.

How can one part bring so much misery? :(

But, despite I thought it was working: my landing leg has problems.

It likes to get stuck in the floor when landing / deploying, it has no suspension!

ec0dcaf90a.jpg

My Unity setup, is as so:

7dbd286a38.jpg

The wheel collider:

c785a4da16.png

The leg colliders (that get stuck in the floor).

80e2cd1fb6.png

My Config

PART
{
name = Libra_Leg_A
module = Part
author = Beale

MODEL
{
model = Tantares/Parts/LK/LK_Leg_A
}
scale=1

node_attach = 0.0, 0.0, 0.0, 1.0, 0.0, 0.0

TechRequired = landing
entryCost = 2200
cost = 200
category = Utility
subcategory = 0
title = LT-5 Micro Landing Strut
manufacturer = Moving Parts Experts Group
description = A small landing leg designed for space probes or lightweight landers. Basically made of toothpicks... erm, Space-grade toothpicks mind you, but be careful with them anyway.

attachRules = 0,1,0,0,0

mass = 0.015
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 10
maxTemp = 2900

explosionPotential = 0

MODULE
{
name = ModuleLandingLeg

animationName = Libra_Leg_A_Deploy
wheelColliderName = wheelCollider
suspensionTransformName = Lower
suspensionUpperLimit = 0.65
impactTolerance = 150
suspensionSpring = 1
suspensionDamper = 1
}

}

Did I make a huge mistake somewhere?

Sorry to make another landing leg thread for the forum, but others are difficult to follow for me.

Link to comment
Share on other sites

Huge mistake? Most of the common ones, actually, but it's easily fixed ;)

If you're happy to, bundle it up as a .unitypackage (in Unity, select the scene, model, texture and anything else that belongs to that part, right click and select export), send over and I'll rejig, then post back the fixed model with explanations.

Link to comment
Share on other sites

Huge mistake? Most of the common ones, actually, but it's easily fixed ;)

If you're happy to, bundle it up as a .unitypackage (in Unity, select the scene, model, texture and anything else that belongs to that part, right click and select export), send over and I'll rejig, then post back the fixed model with explanations.

Hey thanks!

Here is the package! I hope this includes needed files.

Many thanks! :)

Link to comment
Share on other sites

There you go.

Key things are:

Wheel collider needed to be child of lower.

suspensionTransformName = Libra_Leg_A_Lower_Libra_Leg_A_Lower_auv

Colliders needed to be set to layer 26 WheelCollidersIgnore or the wheel collider hits them rather than anything else.

I've play with the size and placement of the lower collider. Set it too low, and it hits the ground rather than the WC which will stop the suspension working and make them stick. It's presence is desirable because it helps place the craft of launched with landing gear extended.

I've updated the suspension and grip settings to something that seems appropriate to their size as well, and they seem to work nicely in game.

Updated config:



PART
{
name = Libra_Leg_A
module = Part
author = Beale


MODEL
{
model = Tantares/Parts/LK/LK_Leg_A
}
scale=1


node_attach = 0.0, 0.0, 0.0, 1.0, 0.0, 0.0


TechRequired = landing
entryCost = 2200
cost = 200
category = Utility
subcategory = 0
title = LT-5 Micro Landing Strut
manufacturer = Moving Parts Experts Group
description = A small landing leg designed for space probes or lightweight landers. Basically made of toothpicks... erm, Space-grade toothpicks mind you, but be careful with them anyway.


attachRules = 0,1,0,0,0


mass = 0.015
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 10
maxTemp = 2900


explosionPotential = 0


MODULE
{
name = ModuleLandingLeg


animationName = Libra_Leg_A_Deploy
wheelColliderName = wheelCollider
suspensionTransformName = Libra_Leg_A_Lower_Libra_Leg_A_Lower_auv
suspensionUpperLimit = 1 //play with this until you reach a setting you like.
impactTolerance = 150
suspensionSpring = 0.1
suspensionDamper = 0.01
}


}

Link to comment
Share on other sites

There you go.

Key things are:

Wheel collider needed to be child of lower.

suspensionTransformName = Libra_Leg_A_Lower_Libra_Leg_A_Lower_auv

Colliders needed to be set to layer 26 WheelCollidersIgnore or the wheel collider hits them rather than anything else.

I've play with the size and placement of the lower collider. Set it too low, and it hits the ground rather than the WC which will stop the suspension working and make them stick. It's presence is desirable because it helps place the craft of launched with landing gear extended.

I've updated the suspension and grip settings to something that seems appropriate to their size as well, and they seem to work nicely in game.

Updated config:



PART
{
name = Libra_Leg_A
module = Part
author = Beale


MODEL
{
model = Tantares/Parts/LK/LK_Leg_A
}
scale=1


node_attach = 0.0, 0.0, 0.0, 1.0, 0.0, 0.0


TechRequired = landing
entryCost = 2200
cost = 200
category = Utility
subcategory = 0
title = LT-5 Micro Landing Strut
manufacturer = Moving Parts Experts Group
description = A small landing leg designed for space probes or lightweight landers. Basically made of toothpicks... erm, Space-grade toothpicks mind you, but be careful with them anyway.


attachRules = 0,1,0,0,0


mass = 0.015
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 10
maxTemp = 2900


explosionPotential = 0


MODULE
{
name = ModuleLandingLeg


animationName = Libra_Leg_A_Deploy
wheelColliderName = wheelCollider
suspensionTransformName = Libra_Leg_A_Lower_Libra_Leg_A_Lower_auv
suspensionUpperLimit = 1 //play with this until you reach a setting you like.
impactTolerance = 150
suspensionSpring = 0.1
suspensionDamper = 0.01
}


}

Thankyou for the explaining! :)

You are a life-saver!

Ehm, but how do I use the returned Unity Package?

(Also if you have example of working game version, that would be so helpful as well!)

I've tried to import it, but see nothing...

Edited by Beale
Link to comment
Share on other sites

No worries.

I realised I forgot to resave the scene before exporting, so download the updated copy. Best thing to do is rename the existing scene and double click the package to import. It doesn't import any existing assets.

Link to comment
Share on other sites

Thank you so much!

But, still I am suffering bugs, is it the same on your end?

"Retract animation" Legs lower goes inside, and up. Clipping

c412278476.jpg

When re-deploying legs, they do not push the craft up

0ba318a1ac.jpg

Also the legs float a little above the ground.

Sorry for more problems!

Edit:

Clipping problems are still quite severe also.

8767d1deee.jpg

Edited by Beale
Link to comment
Share on other sites

Nope, something very wrong there.

This is as it should be.

Looks like you've updated the config, but not re-exported the part using the updated scene?

Strange, I just tried your setup, same result :huh:

Although it does not seem to clip through the floor any more, which is good!

6c5d621f9f.jpg

I did re-export from the scene, but it seems something has gone wrong... :(

Edited by Beale
Link to comment
Share on other sites

Oh. I see what's going on. It doesn't seem to like the animated leg extension for some reason. Sometimes it's OK, others not. MLL is a fickle beast!

I'll have a play around with it, but I've seen people struggle with this before...

Link to comment
Share on other sites

Oh. I see what's going on. It doesn't seem to like the animated leg extension for some reason. Sometimes it's OK, others not. MLL is a fickle beast!

I'll have a play around with it, but I've seen people struggle with this before...

Oh ok!

Thank you very kindly for the help on this, please feel no obligation to lose too much free time over it, but it is much appreciated if you find what is breaking it! :)

Link to comment
Share on other sites

I made a few small changes - The lower collider is now a bit longer.

New config:

PART
{
name = Libra_Leg_A
module = Part
author = Beale

MODEL
{
model = Tantares/Parts/LK/LK_Leg_A
}
scale=1

node_attach = 0.0, 0.0, 0.0, 0.0, 0.0, 1.0

TechRequired = landing
entryCost = 2200
cost = 200
category = Utility
subcategory = 0
title = LT-5 Micro Landing Strut
manufacturer = Moving Parts Experts Group
description = A small landing leg designed for space probes or lightweight landers. Basically made of toothpicks... erm, Space-grade toothpicks mind you, but be careful with them anyway.

attachRules = 0,1,0,0,0

mass = 0.015
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 10
maxTemp = 2900

explosionPotential = 0

MODULE
{
name = ModuleLandingLeg

animationName = Libra_Leg_A_Deploy
wheelColliderName = wheelCollider
suspensionTransformName = Lower
suspensionUpperLimit = 1
impactTolerance = 1500
suspensionSpring = 0.1
suspensionDamper = 0.01
}

}

But still, problem.

Extend okay.

8e20846600.jpg

Retract okay.

1b2476ef95.jpg

But, it has zero strength - no resistance hitting ground, it slides up and over top of holding leg.

5da338edb0.jpg

Link to comment
Share on other sites

I made a few small changes - The lower collider is now a bit longer.

New config:

PART
{
name = Libra_Leg_A
module = Part
author = Beale

MODEL
{
model = Tantares/Parts/LK/LK_Leg_A
}
scale=1

node_attach = 0.0, 0.0, 0.0, 0.0, 0.0, 1.0

TechRequired = landing
entryCost = 2200
cost = 200
category = Utility
subcategory = 0
title = LT-5 Micro Landing Strut
manufacturer = Moving Parts Experts Group
description = A small landing leg designed for space probes or lightweight landers. Basically made of toothpicks... erm, Space-grade toothpicks mind you, but be careful with them anyway.

attachRules = 0,1,0,0,0

mass = 0.015
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 10
maxTemp = 2900

explosionPotential = 0

MODULE
{
name = ModuleLandingLeg

animationName = Libra_Leg_A_Deploy
wheelColliderName = wheelCollider
suspensionTransformName = Lower
suspensionUpperLimit = 1
impactTolerance = 1500
suspensionSpring = 0.1
suspensionDamper = 0.01
}

}

But still, problem.

Extend okay.

http://puu.sh/goQBp/8e20846600.jpg

Retract okay.

http://puu.sh/goQCm/1b2476ef95.jpg

But, it has zero strength - no resistance hitting ground, it slides up and over top of holding leg.

http://puu.sh/goQCB/5da338edb0.jpg

Sorry to bump my own thread, but there is no one able to help? I'm flailing in Unity, but nothing is improving

Link to comment
Share on other sites

It's one of the harder things to get to grips with, I'm afraid. Doesn't help that MLL has its quirks, and I'm afraid I've not had time to do much investigation myself. You may find it easier to understand what's going on by making a wheel. Doesn't have to be a fancy textured model, just simple, untextured primitives will do. You'll find a tutorial YouTube I made in the mode dev links sticky. MLL seems to share a lot in common with ModuleWheel, so it may give you some insights.

I have a slightly deeper understanding having written my own wheel module that runs my tracks, wheels and just about everything else, so extrapolating what the stock modules do is a lot easier. Like I said, I think the root cause of the problems you're having is with the leg extension part of the retract animation. Because of the way the MLL is set up, the WC and the suspension transform have to be set in the same place. Moving a wheel collider with an animation is a very bad idea, because this happens in a non-kinematic way. To cut a long story short, the WC doesn't really know what on earth it's doing when it's moved - as far as it's concerned - magically outside what the physics engine is doing by the animation. This seems to make it unreliable.

TL;DR - It probably can't be made to work reliably the way you're trying. Use the rig I provided and remove the animation keys from the "lower" transform. You'll get a working leg, it just won't be as compact when retracted. Beyond that, you'll need a custom module.

Link to comment
Share on other sites

It's one of the harder things to get to grips with, I'm afraid. Doesn't help that MLL has its quirks, and I'm afraid I've not had time to do much investigation myself. You may find it easier to understand what's going on by making a wheel. Doesn't have to be a fancy textured model, just simple, untextured primitives will do. You'll find a tutorial YouTube I made in the mode dev links sticky. MLL seems to share a lot in common with ModuleWheel, so it may give you some insights.

I have a slightly deeper understanding having written my own wheel module that runs my tracks, wheels and just about everything else, so extrapolating what the stock modules do is a lot easier. Like I said, I think the root cause of the problems you're having is with the leg extension part of the retract animation. Because of the way the MLL is set up, the WC and the suspension transform have to be set in the same place. Moving a wheel collider with an animation is a very bad idea, because this happens in a non-kinematic way. To cut a long story short, the WC doesn't really know what on earth it's doing when it's moved - as far as it's concerned - magically outside what the physics engine is doing by the animation. This seems to make it unreliable.

TL;DR - It probably can't be made to work reliably the way you're trying. Use the rig I provided and remove the animation keys from the "lower" transform. You'll get a working leg, it just won't be as compact when retracted. Beyond that, you'll need a custom module.

Hi! Thanks for the advice!

It really is a troubling module..

I guess I can try what you suggest, but, stock legs work - so surely there's a correct way to do this?

Link to comment
Share on other sites

I can't remember if the stock legs animate extension in the same way as you're trying?

Good thing to do would be to use the blender .mu importer and have a peek at the stock leg hierarchy. Compare that to the config and you should get some answers :)

Link to comment
Share on other sites

I can't remember if the stock legs animate extension in the same way as you're trying?

Good thing to do would be to use the blender .mu importer and have a peek at the stock leg hierarchy. Compare that to the config and you should get some answers :)

Oh!

That is a nice idea, shall do :)

Link to comment
Share on other sites

  • 3 months later...
There you go.

Key things are:

Wheel collider needed to be child of lower.

suspensionTransformName = Libra_Leg_A_Lower_Libra_Leg_A_Lower_auv

Colliders needed to be set to layer 26 WheelCollidersIgnore or the wheel collider hits them rather than anything else.

I've play with the size and placement of the lower collider. Set it too low, and it hits the ground rather than the WC which will stop the suspension working and make them stick. It's presence is desirable because it helps place the craft of launched with landing gear extended.

I've updated the suspension and grip settings to something that seems appropriate to their size as well, and they seem to work nicely in game.

Updated config:



PART
{
name = Libra_Leg_A
module = Part
author = Beale


MODEL
{
model = Tantares/Parts/LK/LK_Leg_A
}
scale=1


node_attach = 0.0, 0.0, 0.0, 1.0, 0.0, 0.0


TechRequired = landing
entryCost = 2200
cost = 200
category = Utility
subcategory = 0
title = LT-5 Micro Landing Strut
manufacturer = Moving Parts Experts Group
description = A small landing leg designed for space probes or lightweight landers. Basically made of toothpicks... erm, Space-grade toothpicks mind you, but be careful with them anyway.


attachRules = 0,1,0,0,0


mass = 0.015
dragModelType = default
maximum_drag = 0.2
minimum_drag = 0.2
angularDrag = 2
crashTolerance = 10
maxTemp = 2900


explosionPotential = 0


MODULE
{
name = ModuleLandingLeg


animationName = Libra_Leg_A_Deploy
wheelColliderName = wheelCollider
suspensionTransformName = Libra_Leg_A_Lower_Libra_Leg_A_Lower_auv
suspensionUpperLimit = 1 //play with this until you reach a setting you like.
impactTolerance = 150
suspensionSpring = 0.1
suspensionDamper = 0.01
}


}

After over a year of searching, I finally got solution for my problem even it is totally different than this one... But, anyway thanks a lot :)

Edited by neomax
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...