Jump to content

[1.0.4] Help with configs and collision meshes, please


nestor_d

Recommended Posts

Hi people!

I'm in the initial stages of developing a Mk3 replacement cockpit, fit for more sleek spaceplanes. Here's the WIP thread http://forum.kerbalspaceprogram.com/threads/129666-WIP-Mk3-Hypersonic-cockpit

Now, I still have to do some work on the texturing, but the basic shape and scaling is fine. However everything else is all messed up, the attachment nodes are just floating around and the collision mesh is just a box at the moment. It also does some pretty weird things with physics, as soon as I launch a plane using that cockpit, the rest of the plane breaks up from the cockpit and just goes floating upwards like a balloon. I'm guessing the physics issues have to do with the config file (for now I just copied the stock Mk3 cockpit config and edited it a bit), and the issue with the nodes not being in place has to do in part with the config, but also with the actual placement of the mesh inside blender and/or Unity. So some questions: 1) Is there any good documentation around for writing cfg files? The documentation on the KSP wiki is for version 0.25, and the examples don't look very similar to how actual stock cfgs look like in 1.0.4. 2) Does the position of a mesh inside unity matter? (I know rotarion matters, I'm guessing yes, but I'm not sure exactly how). 3) How do I import a mesh into Unity to act as a collision mesh, so I can use something similar to the shape of the model and not just a box or a capsule?

Thanks!

Link to comment
Share on other sites

1) the stock configs are about the best documentation you're going to get.

2) The position of items in relation to the root object that has part tools applied matters. Unless you mess with CoMOffset in the config, it's position is the centre of mass.

3) you just use a mesh. In unity, remove the mesh renderer component, which stops it being visible. Add a mesh collider component. I cannot stress enough that this should be a _simple_ approximation of your part. The fewer triangles the better. You must also select the "convex" check box.

The physics issues are unlikely to have much to do with the config unless you've done something really silly. Read up on attach nodes and you'll soon figure out what you're supposed to be doing to get them in the right place. Good luck!

Link to comment
Share on other sites

1) the stock configs are about the best documentation you're going to get.

2) The position of items in relation to the root object that has part tools applied matters. Unless you mess with CoMOffset in the config, it's position is the centre of mass.

3) you just use a mesh. In unity, remove the mesh renderer component, which stops it being visible. Add a mesh collider component. I cannot stress enough that this should be a _simple_ approximation of your part. The fewer triangles the better. You must also select the "convex" check box.

The physics issues are unlikely to have much to do with the config unless you've done something really silly. Read up on attach nodes and you'll soon figure out what you're supposed to be doing to get them in the right place. Good luck!

Ok, so if I understand correctly the "coordinares" for the nodes are basically the number of meters that a node is offset from the CoM in each direction, right?

About the collision, mesh I have a very low poly mesh that has the basic shape of my model. My question is can I import that into unity and then tell unity to read it as a collision mesh or do I need to actually model the collision mesh inside of unity?

Link to comment
Share on other sites

There are two sets of coordinates for each node. One is a vector, which gives the node direction, the other defines it's position in relation to the root transform. I forget which way round they are (not at my PC), but I'm pretty sure it's direction first, then position. The last number, if a stack node, is size. Look at, and play around with, the truss pieces for an easy example.

You can't model in Unity anyway, so run through the instructions above with your mesh you've made and you'll easily figure it out.

Link to comment
Share on other sites

There are two sets of coordinates for each node. One is a vector, which gives the node direction, the other defines it's position in relation to the root transform. I forget which way round they are (not at my PC), but I'm pretty sure it's direction first, then position. The last number, if a stack node, is size. Look at, and play around with, the truss pieces for an easy example.

You can't model in Unity anyway, so run through the instructions above with your mesh you've made and you'll easily figure it out.

I did what you suggested, I looked at some of the stock configs so the nodes are finally set up correctly. I also managed to set up the collision mesh, so that's finally ok as well. Physics are still giving me a hard time, but I figure you're probably right and it has nothing to do with the cfg. I'm thinking the issue is probably coming from the fact that I have Kerbal Joint Reinforcement installed, which changes physics a little bit. I'll un install it and also post a pre-release fore some people to try it to ser if the issue persists. Thanks for all your responses, they've been really helpful!

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