Jump to content

Hatches *not* being obstructed properly


Recommended Posts

I've recently released a line of space station modules, with the airlock intentionally assigned to a hatch hidden directly under an attachment node ( I didn't like the idea of superfluous hatches).

The airlock itself works well - too well, in fact - if any other module or part is placed over the "airlock" hatch, rather than displaying a "Hatch Obstructed" message when EVA is attempted, Kerbals would still pop out, causing the part supposedly blocking the hatch to explode / be flung off.

I've attached screencap from Unity to help describe my current setup:

- The large cubic collider is the airlock

- The smaller cubic collider is the ladder for the airlock

- The hatch geometry mesh has its own convex collider

- The main part collider is slightly smaller than the actual module fuselage, as I needed to cater for the side docking nodes

untitled_1_by_sumghai-d69soh5.png

What might I have missed?

Link to comment
Share on other sites

First thing to note, I'm pretty sure your colliders there are not convex, which is bad bad bad! Always tick the Convex box on your Mesh Colliders, otherwise they won't collide properly and will sink through the ground and do all manner of nasty things. In fact, this might be the cause of your problem, too. The collision detection code to see if hatches are blocked might not work if the collider isn't convex. In particular, this main body segment raises my alarm:

wDdJswf.png

If the other modules don't have the convex flag ticked on their colliders then I think that will be the cause of your issues, for the reasons mentioned above.

Edited by NovaSilisko
Link to comment
Share on other sites

First thing to note, your colliders there are NOT convex, which is bad bad bad bad bad bad! Always tick the Convex box on your Mesh Colliders, otherwise they won't collide properly and will sink through the ground and do all manner of nasty things. In fact, this might be the cause of your problem, too. The collision detection code to see if hatches are blocked might not work if the collider isn't convex.

That's strange - according to Unity, the mesh colliders are already convex (checkbox ticked), and my modules have not sunk into the ground, either.

Link to comment
Share on other sites

What about the other modules? Otherwise, I'm not sure.

Also, another note, you should use box colliders instead of actual cube meshes. They're more efficient since they don't have to worry about polygons or anything. I wonder if not having the airlock be one of these could cause it?

Link to comment
Share on other sites

What about the other modules?

Same configurations - all collider meshes are convex.

Also, another note, you should use box colliders instead of actual cube meshes. They're more efficient since they don't have to worry about polygons or anything.

Hmm, I see. Since these box colliders are from Unity itself, they won't be imported via the Blender prefab connection, so I'll have to create them manually, right?

Link to comment
Share on other sites

Yeah, but the game objects should already be there from the original mesh versions, so placement shouldn't be too big of a hassle. Mostly just sizing them (conveniently you ca just directly enter how big you want them to be without messing around with scaling)

Link to comment
Share on other sites

I updated the airlock by changing it to a box collider, and then subsequently applying a (convex) mesh collider to it. No joy.

On a pinch, I even tried removing the main fuselage collider, hoping to deliberately introduce a "Hatch obstructed" scenario. Whilst the part sank into the ground (as expected for this particular hamfisted test), but the Kerbal still was able to exit the hatch.

EDIT: Nova, I see that you've updated your initial response with a snippet from my screencap - the reason for that funny geometry is because of the recessed side docking nodes in this particular part. I cannot "un-recess" them because I needed to ensure continuity with another modder (fusty's) work.

EDIT 2: Interesting - it seems that one of my modules (the Kuest Airlock) has a setup that works properly (airlock colliders correctly detect for collisions, otherwise Kerbals can EVA). I'll try poking at my files a little more and see if I can duplicate this working setup across all my other modules.

Edited by sumghai
Link to comment
Share on other sites

After hours of hair-pulling and messing with throwaway test models, I found a (rather hamfisted) workaround, at least for myself.

It appears that if an airlock is more than 1m away from the part's origin, the hatch obstruction colliders don't work properly. So moved my entire model downwards in Blender by 0.675m, and also lowered the CFG file's attachment node y-values. In other words, I moved the origin of the part upwards closer towards the airlock.

Note that in my particular case, I had some rather tall (~3m) modules with the access hatch at the very top, so this issue only occurs in rare circumstances like mine. The stock capsules and my Kuest Airlock part happens to have their airlock(s) within the 1m limit, hence why they aren't affected.

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