Jump to content

Simple Landing Gear Problem


Recommended Posts

Okay, I feel like this is going to be one of those questions where I've done something really dumb... but I can't get my landing gear to work so I'm asking for help. I'll attach a Unity Screenshot and the .cfg file code I've tried. I've attempted using both the stock landing gear module and the firespitter fswheel module, and neither makes the wheel collide with the ground. If I take all of the modules out of the part then the wheel collides perfectly... but of course it doesn't roll, because it's not a wheel, so turning on the engines makes the landing gear explode from friction.

MODULE{
name = ModuleLandingGear
}
MODULE
{
name = ModuleSteering
controlAxisType = Forward
steeringAxis = 0, 0, 1
steeringTransformName = suspensionParent
steeringLocked = true
steeringCurve
{
key = 0 16
key = 10 9
key = 30 2
key = 100 1
}
}


MODULE
{
name = FXModuleConstrainPosition
matchRotation = true
matchPosition = false
CONSTRAINFX
{
targetName = suspensionParent
moversName = wheelCollider
}

}

(I've tried both with and without the constrainposition module and the steering module - all have the same result - wheel goes through ground and ship belly slides down the runway.)

And the same result with :

MODULE{
name = FSwheel
wheelColliderName = wheelCollider
boundsCollider = Bounds
wheelMeshName = Wheel
suspensionParentName = suspensionParent
rotationAdjustment = 2.0 // adjust the visual rotation speed of the wheel meshes if they are off
numberOfWheels = 1
//animationName = Retract
disableColliderWhenRetracted = False
hasMotor = False
motorEnabled = False // set to false for landing gears to start unpowered.
motorTorque = 2
maxSpeed = 30 // the motorTorque is 1 at 0 speed, and 0 at this speed, meaning the actual max speed is probably way lower.

overrideModelFrictionValues = True

forwardsExtremumSlip = 0.01
forwardsExtremumValue = 1.0
forwardsAsymptoteSlip = 0.04
forwardsAsymptoteValue = 0.6
forwardsStiffness = 6000

sidewaysExtremumSlip = 0.01
sidewaysExtremumValue = 1.0
sidewaysAsymptoteSlip = 0.04
sidewaysAsymptoteValue = 0.6
sidewaysStiffness = 500

resourceConsumptionRate = 0.2
resourceName = ElectricCharge
//motorStartsReversed = True
brakeTorque = 15
brakeSpeed = 0.5
animationLayer = 1
deployedDrag = 0.2
retractedDrag = 0.0
guiActiveUnfocused = True
unfocusedRange = 5.0
brakeEmissiveObjectName = brakeLight
onEmissiveColor = 1, 0.3, 0
offEmissiveColor = 0, 1, 0
deployingEmissiveColor = 1, 0, 0
disabledEmissiveColor = 0, 0, 0

}


MODULE
{
name = FSwheelAlignment
}


In Unity the file is setup with - the top level is a game object named nosegear with parttools added,

Bounds is a game object with box collider that exceeds the bounds of the wheel by a bit...

suspensionParent is an empty game object located at the same center as the Wheel and the wheelCollider

wheelCollider is a game object with a wheelCollider that exceeds the edges of the wheel object by a little bit.

f0LHOWW.png

Link to comment
Share on other sites

I'm not sure I understand... the wheelcollider is round so I thought it needed to be oriented with the wheel, so it would be perpendicular to the ground? I'm going off of what I see in the picture of the stock landing gear in Unity :

i1aPm.png

After your post I tried spinning it to point the blue axis down... And I DID try spinning it so it lay parallel to the ground, perpendicular to the wheel. Neither of these changed the behavior at all. It still sinks right through the gear to rest on its belly. Does the "Bounds" box need a certain orientation?

Does the overall model orientation matter in Unity for landing gear? With the model oriented this way it comes into KSP correctly - that is wheel pointed down - so I assumed it's correct... but it could be totally wrong?

I also should add that the screen shot of my gear is showing the gear in the down position. I haven't added any animation to the model yet, because I wanted to get the pieces working in the right hierarchy first. So the gear is essentially fixed at the moment.

Link to comment
Share on other sites

I did try rotating the whole system to point down in unity (alligning it the same way as the image of the stock gear.) It didn't change anything except the fact that now when I load it in game I have to rotate it 90 degrees one way and 180 degrees another to get it into the right orientation for the model.

Link to comment
Share on other sites

just rotate the wheelcollider; everything else you have look alright. make sure suspensionParent is positioned at the center of the wheelcollider.

the ring should be aligned to direction of travel, in your case, Z axis. Direction doesn't matter.

the green line from center of the wheelcollider should point at the ground, in your case +Z direction. This is relative to how the gear is mounted, so the green line should always point away from the gear bay.

the orientation of the whole system doesn't matter much since it will be surface attached. all you need to set is the attach direction in config.

Edited by nli2work
Link to comment
Share on other sites

Okay... I set the wheelCollider to layer 27 and renamed it WheelColliders... still falls through the ground.

As I've read all of your posts about it... I'm starting to think I'm seeing something different on my wheel collider than you are. If I'm understanding it... you're seeing a green 'ray' that indicates the ground direction and with a length that in someway relates to the suspension distance?... I'm only seeing the normal green, blue, and red axis markers. It's this green arrow that I rotated towards down. Am I looking at it wrong?

Link to comment
Share on other sites

Depends on what's throwing NRE. may or may not be related.

You also want separate transforms for steering and suspension. two modules trying control the same transform will do strange stuff, or not work at all.

yeah you want the greey ray pointed at the ground, not the green component of pivot marker. the green ray indicates suspension direction, and suspension travel distance.

Uce0rLj.jpg

Link to comment
Share on other sites

That helps a lot with understanding suspension... and I found the green ray and now have it pointed at the ground. Nothing I've tried has changed the sinking issue. Any thoughts on whether to use the stock module or the FS version?

EDIT! I switched to the FS module again from the stock one... and it's now working with the collider oriented correctly. I'm going to fiddle around a little to see if I've really got it... or if I've still got a hangup somewhere. If it works I'll post a step by step to try to help future browsers...

Edited by artwhaley
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...