Jump to content

[SOLVED] Wheel Collider default behavior (they are disabled by default!)


Recommended Posts

Hi all,

How are wheel colliders supposed to behave when -not- updated by any Modules?

As far as I can tell the default Unity behavior for them is supposed to be to act like a collider -and- manage the suspension/etc internally. The docs/examples do not use any additional colliders for the wheels and rely on the wheel collider for collision detection and keeping the main body object off/out of the ground. It -looks- like they are supposed to be a plug and play affair.

Edit: Testing in the unity editor, this is indeed the case. Create a rigidbody, add some wheel colliders to empties setup around the geometry appropriately, create a plane/surface for it to collide into. Elevate your rigidbody a bit above the plane to start, and hit the 'play' button. The rigidbody will fall down and rest -on the wheel colliders-.

Now, what I'm seeing in KSP is that wheel colliders just fall completely through the terrain?

I am asking because I'm working on writing a custom multi-suspension point landing leg module, but cannot get the wheel colliders to... well.. collide with anything. Rather, I can see the wheel collider has positioned itself just above the terrain, but the ship/part is being held up by the other box colliders in the model... if I remove those box colliders, the entire thing falls through the ground.

Are wheel colliders supposed to actually collide with terrain/objects and stop falling movement, or am I supposed to be using other colliders for this purpose and manually lining them up with the wheel collider bounds? (seems counterproductive, and might as well write my own wheel collider at that point)

I suppose the actual question is; how do I get wheel colliders to actually -collide- with things and use their suspension values to properly push back/push up on the parent object?

Screenshots to show the problem:

Unity setup:

bJlLOCQ.png

Unity behavior (comes to rest on the wheel colliders):

z91qlAQ.png

KSP Start:

K1qdYLw.png

KSP behavior (wheel colliders fall through the ground):

lzDfDkq.png

Edited by Shadowmage
Link to comment
Share on other sites

Google-fu led me to:http://forum.kerbalspaceprogram.com/threads/28214-wheel-problem where someone stated that wheel colliders are disabled by default.

Okay, so.. apparently... wheel colliders are -disabled by default- in KSP. A big ... there (why disable something that you had to intentionally put on a part/model to begin with?).

As soon as I hooked it up to a simple module that just called wheelCollider.enabled=true in the OnStart() method, the wheel collider started colliding properly. Hooray...now I can start working on things in earnest - testing suspension animation code, playing with spring/damper values/etc. That was a fun two days....

So... future note to anyone with wierd wheel-collider problems -- they have to be manually enabled through plugin code in order to function (as well as be set up properly).

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