Jump to content

[Tutorial] Fairing colliders


Kartoffelkuchen

Recommended Posts

Now that 1.0.5, and soon 1.1, require the use of convex colliders, many problems occured with the concave colliders used before on hollow parts, like fairings.
If you'd simply apply a convex collider to your mesh, you'll run into serious issues when the fairing seperates, since the fairing colliders then collide with the colliders of the parts inside the fairing, and boom, that's it! Now, how to solve this?

1) You have your Fairing/whatever model setted up in Unity. Now, you duplicate your model file, and call it "modelname_collider" or something like that, that doesn't really matter. Now, you open the file.

2) In Blender, I select all faces, except for these in the middle:
xOP3Djw.png
These faces get deleted, so that only a few faces in the middle remain, like shown above. Also, you should be careful, that only the outer faces in the middle remain, make sure that you also delete the inner middle faces.
3) After that is done, you start splitting the faces into individual, seperate objects. To do this, you select faces which form a certain shape, which this image should make clear:
vBE2p97.png
The faces marked in red belong together, the green line represents where the collider will be. To split faces onto the individual groups, you select a category of faces which you think should belong together, and hit "p" on your keyboard and click on "selection".

4) After I splitted the faces into their own groups, it looks like this:
iLMTzDP.png

5) Now you import the collider into Unity, create a new gameobject, call it whatsoever, and make the collider meshes be a child of that gameobject. Then, make the gameobject with the colliders be a child of the gameobject with the fairing you want to export to KSP. Where exactly you put that collider object, that's your decision, but it has to be a child of the parttools gameobject at least. Adjust the rotation so that the fairing meshes point in the same direction as the fairing itself.
6) Now, you add a mesh collider to each of the individual mesh objects of your fairing colliders, and set them all to convex. After that is done, remove the Mesh Filter and the Mesh Renderer components, that only the mesh collider component remains.
7) Now you select the parent object of the individual collider meshes, duplicate it and always adjust its rotation on the vertical axis, that your fairing is covered. You do this until the complete fairing is covered.
8) After 7) is done, it should look like this:
nsqCcRH.png
Then, simply hit write, make your config and done! :)

Now you have a nice fairing collider, which will also work in 1.1. It's a bit of work, but it works really good for me! I hope this tutorial helps you guys, if you have the same problem, and I hope that you understand what I did... o,O

Edited by sumghai
Fixed images
Link to comment
Share on other sites

Thank you Kartoffelkuchen :) Great tutorial, and easy to understand. Somebody should pin this and add it to the [URL="http://forum.kerbalspaceprogram.com/threads/94638-Mod-Development-Links-Compilation-NOW-WITH-TABLE-OF-CONTENTS"]tutorial[/URL] section.
Link to comment
Share on other sites

I just wanted to post a positive feedback on this tutorial, as it was super easy to use and it really worked like a charm. I spent the last hour or so re-doing colliders for my interstages, fairings and other parts that would otherwise behave destructively with convex colliders in 1.0.5. Now I just need to repeat the process a couple more times and then all my parts and launchers should be good to go with both 1.0.5 and 1.1.

Thanks again Kartoffelkuchen :) Here, have some rep.
Link to comment
Share on other sites

  • 1 month later...
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...