Jump to content

[Tutorial] Animated Landing Leg w/ Suspension


BahamutoD

Recommended Posts

That's another major gotcha with wheels as well if I recall correctly.

The setup and config for legs is very similar to wheels, a tutorial for which can be found

. Same goes for landing gear. Probably goes through some of the common mistakes in there, so worth a watch. The bit about colliders (not wheel colliders) in the wheel applies to colliders in feet just the same, and IIRC, it goes through placement of the wheel colliders and other GameObjects like suspension, which applies equally to the piston in a landing leg.
Link to comment
Share on other sites

Found the problem. Somewhere along the way, I got my wheel collider position out of place with what the piston's origin (transform center) was doing. They were 0.5m apart at the end of the deployment animation.

Yeah, animating the piston itself is a really bad idea, I've learned. Instead, I use an Empty as the parent of the piston and extend that instead of the piston itself. The real benefit is that you can attach the wheel collider to the Empty, which means the piston collider and wheel collider will always be in sync, since they never move in relation to each other.

Link to comment
Share on other sites

Yeah, animating the piston itself is a really bad idea, I've learned. Instead, I use an Empty as the parent of the piston and extend that instead of the piston itself. The real benefit is that you can attach the wheel collider to the Empty, which means the piston collider and wheel collider will always be in sync, since they never move in relation to each other.

Having animation attached to the same object that you expect KSP to animate through a module is a bit of an issue.

I think I have my leg issues sorted, although I will be a while getting the spring strength and damping correct, I imagine. But I have an apparently working set of very basic legs. And I had my stuff all wrong before. :-)

Link to comment
Share on other sites

Yeah, animating the piston itself is a really bad idea, I've learned. Instead, I use an Empty as the parent of the piston and extend that instead of the piston itself. The real benefit is that you can attach the wheel collider to the Empty, which means the piston collider and wheel collider will always be in sync, since they never move in relation to each other.
Having animation attached to the same object that you expect KSP to animate through a module is a bit of an issue.

Animating the piston itself works fine, as long as everything lines up correctly at the end of the animation. :)

I've done so few legs, so infrequently, and they're so ridiculously complex and picky compared to most other parts, that I invariably screw something up each time I make a new set. I thought launch clamps were bad, then I tried legs... ugh. Clamps are a walk in the park in comparison.

Link to comment
Share on other sites

Yeah, animating the piston itself is a really bad idea, I've learned. Instead, I use an Empty as the parent of the piston and extend that instead of the piston itself. The real benefit is that you can attach the wheel collider to the Empty, which means the piston collider and wheel collider will always be in sync, since they never move in relation to each other.

I forgot to mention, I think this is a really great idea! I may use that in the future.

Link to comment
Share on other sites

Well, I'm embarassed as f*ck by my own daftness. After many many hours of messing with absolutely everything to do with wheelColliders, ModuleLandingLegs, Unity heirarchy and all that, I've discovered my cfg referenced the wrong mesh name. Suddenly things behave a lot better. And I only noticed because I built completely new Blender meshes, created a new Unity game object and exported to a new folder and copied over the cfg.

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