Jump to content

Animating multiple landing legs?


Recommended Posts

Quick question for anyone who can help.

Have a part all setup with 4 landing legs, they all use the same animation, and they all animate and work just fine in unity when previewed,

Wondering if im doing something wrong with the setup in unity , or the config setup. When the part is imported into KSP and i use the standard. "ModuleLandingLeg" only one leg will work properly (so im assuming its a unity setup issue.)

Here is the config part


MODULE
{
name = ModuleLandingLeg


animationName = Deploy
wheelColliderName = WheelCollider
suspensionTransformName = Piston
suspensionUpperLimit = 2
orientFootToGround = true
landingFootName = FootTransform
impactTolerance = 20000
suspensionSpring = 100
suspensionDamper = 55
}

And here is how its setup in Unity:

6Qf0WSm.png

Does all the gear need to be under one object?

Any insight would be appreciated! (and if more info is needed just let me know what to provide. Thanks!

Link to comment
Share on other sites

The limitation with the stock module is one ModuleLandingGear{} in the part. Animating multiple legs driven from a single instance should be entirely possible, which is what I think rabidninjawombat is trying to do(?) But I could be wrong. That does limit you to one wheel collider in the part, of course.

Link to comment
Share on other sites

I have gotten the multi-leg in a single part to function by adding multiple ModuleLandingleg modules, one for each wheel collider/suspension transform pair. They need to be all driven by the same animation, but have independent suspension and collider transforms. It is a slight bit buggy, insomuch as there are multiple 'retract' / 'extend' buttons on the part that all need to be activated by the user.

Alternatively, if you are up for some custom plugin work, I have a cleaned up multi-leg handling Landing leg module that you are welcome to adapt/use/derive your own code from: https://github.com/shadowmage45/SSTULabs/blob/master/Source/Module/SSTULandingLeg.cs (example of config may be found at: https://github.com/shadowmage45/SSTULabs/blob/master/GameData/SSTU/Parts/ShipCore/series_c/SC-C-109a-LM.cfg#L216).

Link to comment
Share on other sites

I know you want to put everything on one part but don't do it. It causes nothing but problems. The game is built to have independent parts.

And lags terribly when you use said parts as often as they need to be used (at least in anything beyond basic designs). Why have 4 parts just for landing legs when 1 will do? That gives room for more engines, fuel tanks, whatever, before the part-count-lag kicks in. I would -love- nothing more than to not worry about part-count induced lag. Unfortunately it is an absolutely massive problem, and some of us are trying to find ways to mitigate it as much as possible so that we can still enjoy playing the game (rather than swear and curse at a slideshow).

Link to comment
Share on other sites

Roverdude has created some parts with integrated landing legs. MKS/OKS has them, as does the mod with the rover and it's delivery system (exploration something or other).

Examining working examples tends to help me figure out what I'm messing up.

Link to comment
Share on other sites

I have gotten the multi-leg in a single part to function by adding multiple ModuleLandingleg modules, one for each wheel collider/suspension transform pair. They need to be all driven by the same animation, but have independent suspension and collider transforms. It is a slight bit buggy, insomuch as there are multiple 'retract' / 'extend' buttons on the part that all need to be activated by the user.

Alternatively, if you are up for some custom plugin work, I have a cleaned up multi-leg handling Landing leg module that you are welcome to adapt/use/derive your own code from: https://github.com/shadowmage45/SSTULabs/blob/master/Source/Module/SSTULandingLeg.cs (example of config may be found at: https://github.com/shadowmage45/SSTULabs/blob/master/GameData/SSTU/Parts/ShipCore/series_c/SC-C-109a-LM.cfg#L216).

Thanks for all the advice everyone!

Shadowmage, i tried the multiple ModuleLandingLegs, (each with their unique named transforms, using same animation) I get the 4 deploy buttons, but it still seems to only operate one leg (will double check my work :P)

@Lo-fi yea, that what im trying to do. Animating multiple legs driven from a single instance. Id imagine if i redid the animation and model in blender (with the legs) id have no issues.

Was attempted to save time, as I already have the (individual) legs working as a part already. Basically imported the model onto my main part in Unity, (which is why they are separate objects like that in unity).

Link to comment
Share on other sites

Something to consider is that the Unity 5 update is right around the corner, and the whole wheel collider and suspension system is being replaced. It may be more buggy, or less buggy, to try these things in the very near future. Personally, I'd hold off on the experimentation for a few weeks. :)

Link to comment
Share on other sites

Something to consider is that the Unity 5 update is right around the corner, and the whole wheel collider and suspension system is being replaced. It may be more buggy, or less buggy, to try these things in the very near future. Personally, I'd hold off on the experimentation for a few weeks. :)

yea thats honestly what i was thinking :D Thanks Necrobones.

Called the part complete, and will let the user add the legs :P

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...