Jump to content

hollow cargo bay (B9 derivative), issue: single object with multiple collision meshes


Recommended Posts

SOLVED.

ok, so here goes.

I have been an avid fan of making SSTO's for about a year now, and with the B9 pack and FAR I can take +300t of rocket into LKO. However, there are no cargo bays large enough for that kind of cargo.. So last week I decided to learn to use Blender + Unity to first modify the B9 S2W 6m cargo bay so it could take 3m rocket parts and to make adapters from S2W to what I currently dub S2WD. (D for doubious). On the long term I intend to make B9 compatible parts that can take huge internal payloads and have both top and rear cargobay doors with enough clearance that anything that actually fits the cavity will be able to enter/leave (an issue I have had with MK4 cargo bay doors).

But before I can do that, I need to understand what I'm currently doing wrong.

I'm using Unity 4, Blender 2.70, part tools 0.23.

So what is the problem? Collision meshes.

No, what is the real problem? When in the VAB or in flight, only one of the mesh colliders (out of 11) act like a collision mesh in the cargo bay hull part. While the multiple mesh colliders (2) used on the cargo bay doors are correct. (!)

detailed:

I imported the S2W 6m cargo bay into blender with .mu import script,

modified the model by adding 1m of height,

made convex mesh colliders (boxes) for all the sidewalls, floors and cargo bay doors.

Nope, not one single mesh collider but actually colliders that are individually convex and together match the new S2WD 6m Cargo bay.

Nothing.. nada.

I've tried a few different approaches by now.

1. I used edge split in blender on the mesh colliders. =nada.

2. I duplicated each mesh collider and inverted the normals of the new duplicate. =nada.

3. I made sure none of the mesh colliders overlap in case that was screwing things up. =nada.

4. I made placeholders for each mesh colliders as actual objects, assigned the placeholders a individual mesh collider, then told Unity to not render the objects.

Then mesh collision works correctly but KSP renders the placeholders objects.

For me it seems that I am either missing a critical piece of information about mesh colliders. Or there is some sort of trick to making hollow objects.

What am I doing wrong?

And what can I do to make it easier for you to understand my problem?

Here are pictures of the part. The first picture show correct placement of an object on the left side of the part. However, it is not possible to place the same object on the right side. If I however turn on 2-fold symmetry, then the 2nd part is placed correctly.

https://www.dropbox.com/sh/4cqcdr46z5iw0ah/AAA5wJq-JP__6xgmpWpQ2BAPa

Edited by IXian probe
Issue solved!
Link to comment
Share on other sites

have you tried a series of simple box colliders instead of mesh colliders? you can't have multiple collider components on a single game object in KSP, it will just pick the 1st one and ignore the rest. all colliders must be separate game objects without mesh filter and mesh renderer component.

Link to comment
Share on other sites

There usually is no need to ever use box colliders outside of box-shaped parts.

Make sure you have every single collider marked as Convex in the Unity editor inspector properties of the Mesh Collider components, otherwise they will not be used by the game even if their shape is convex.

Link to comment
Share on other sites

I know I dont use blender but I reckon that the process must be similar. I will say that my experience with .mu exports is that they need a lot of cleaning up before you can work on them, typically it multplies colliders, ads extra transforms misplaces pivots, etc etc.

This is how i do a cargo bay, I cant work out what your prob is, but I know that this way works for me everytime, and I've made a fair few of these for various things.

Bearing in mind this is a fresh not recycled via mu model, I break it into chunks that will form walls, roof , sides , ends etc you can see in first pic the wire frame each of those colors represents a seperate object which will carry a std unity convex mesh collider.

I've not made seperate collider objects for anything non spherical, round since the early days of ksp. Below is the image in game once complete.

Occasionaly I find I break the 255 triangle limit doing it this way and have to redo the sections but not often.

If you cant get it to work I'd quite happily take a swing at it, after all two heads are better than one

Ukksu1v.png

DKCuupx.png

Edited by SpannerMonkey(smce)
Link to comment
Share on other sites

have you tried a series of simple box colliders instead of mesh colliders? you can't have multiple collider components on a single game object in KSP, it will just pick the 1st one and ignore the rest. all colliders must be separate game objects without mesh filter and mesh renderer component.

Thank you, problem solved. the clue was that there can only be one collider for each game object combined with me deleting the Mesh Renderer component in Unity for the dummy objects.

Onwards to the next challenge, how to make textures. :)

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