Jump to content

[SOLVED] Hatch obstructed


Recommended Posts

//----------------------Solved - 9th September-------------------//

My hatch issues now seem to be solved, it was a simple matter of having to have the Origin of the unity object (0,0,0) within the models collider. a small but vital issue it seems.

by offsetting my models node_colliders by -.001 on the y (green/up axis) i was able to get all my parts hatches to work. I still get the occasional catapulted kerbal, but at least they're not trapped inside.

some other snippets below also still apply, like the size of the airlock collider, although I've read that .5 x and .5 z will still work I haven't tried it.

Thanks to Touhou Torpedos information on his IVA tutorial for enabling me to fix my hatches. http://forum.kerbalspaceprogram.com/showthread.php/45070

//----------------------Some progress - 7th September-------------------//

I discovered a couple of issues with my horrible hatches after spending a few hours working on them this afternoon.

1) My hatch colliders were too small, I had a cube 0.5m on each side. I've found that an object 1m tall (Y axis) .65m wide (x axis) and .60m deep (z axis) is good for spawning a kerbal without any issues. At least this is one problem elimintated.

2) there's some sort of problem with some of my objects colliders, I use 4 convex mesh colliders , with 2 of them in, the hatch still works without a problem, when I try to add in either of the other 2, I get a "hatch obstructed" message. It doesn't seem to be a positioning issue, will try some different shaped colliders but i've run out of patience with it for the moment.

//----------------------------------------------------------------------------//

Still not working for me in all cases, I've now got about 6 command pod models, all modelled and textured and in-game. So far, I've only been able to get my hatches working on 2 of the models, a 3rd one works after frantic clicking on the EVA and the others just refuse to work. I've checked and double checked everything for them but I'm still not having any luck. The steps in the solution I wrote below are not working for me any more.

//----------------------------A Possible Solution--------------------------//

Thanks to the replies I got below i was able to fix my hatches on 2 models and get them working consistently on my test launch vehicles. here's a few steps in case anyone searches out this thread with similar problems.

1 - I created a 1m x 1m x 1m box in my modelling program of choice (Maya) and exported as an .OBJ file.

2 - I created an empty game object for my airlock.

3 - I added a mesh collider to the gameobject and linked in the box mesh I exported earlier.

4 - I made sure that is trigger and convex were both ticked in the mesh collider component.

5 - I made sure that the gameobject was on the correct layer (Part Triggers), and had the correct tag (Airlock)

6 - I positioned the airlock object making sure that A) all sides were a minimum of 0.5m long (i.e. scale of my transform component was not less than 0.5)

B) the Z (blue) axis faced in towards my node_collider and y (green) was in the right direction for the "up" I wanted.

C) the origin (transform) of the gameobject was positioned at least 0.2m away from the surface of my node_collider.

d) my mesh collider for the airlock intersected my node_collider by a small amount (perhaps about 0.04m into it, this amount seems a little arbitrary)

7 - I then duplicated the whole airlock object and renamed it to ladder, I also changed the tag to Ladder.

8 - I resized the ladder by scaling, but keeping the origin of the object the same as the airlock. I made sure that the mesh collider for the ladder did not intersect my node_collider, but was just above the surface of it.

I still had to fiddle with positions and sizes for the airlock and ladder on my Ranger 25 model to get it working, it took a few tries but it now seems to pop a kerbal out fairly consistently on the launchpad.

//----------------------------The Problem--------------------------//

I've been trying to get the hatch and ladder on the part pictured below to work and it just doesn't want to work consistently.

I've looked at and followed the wiki tutorial and also gone through a couple of threads here on the forums that were related to correct placement of hatch colliders and have had no luck getting this hatch to work.

I've made quite a few adjustments to the hatch objects and a few times I've had it working, but even then it only pops out a kerbal after clicking on the EVA button 10 - 20 times, otherwise all I get is the "can't exit, Hatch obstructed" message. I'm sure i've got the basics right, but there must be something I'm doing wrong.

- the hatch and ladder have the same origin point.

- the hatch and ladder colliders do not intersect the node_collider (I've also tried it where they do, It's made no difference so far).

- the Z (blue) axis is facing into the node_collider with the Y (green) axis facing the way I want "up" to be.

- the hatch is a trigger, as is the ladder.

Is there something really simple I've missed?

Do the hatch and ladder colliders need to be a certain size to spawn a kerbal correctly?

Should the hatch and ladder colliders intersect the node_collider or not? (I've seen conflicting answers to this already)

Screenshots below, I would really appreciate it if someone with a bit of know how on this could have a look and see if i've done something wrong.

Javascript is disabled. View full album
Edited by Ohfive30
fixed now.
Link to comment
Share on other sites

My understanding and first-hand experience has been that the airlock and ladder colliders need to be convex, in addition to being Part Triggers.

I usually model them in Blender, assign mesh colliders to them in Unity and tick the convex option.

Link to comment
Share on other sites

Make the hatch collider a large cube, about 0.5 units on a side, and stand it off the model's collider by about 0.2 units. It doesn't seem to work well if it's too small, especially in the Z dimension. Probably because the kerbal is spawned at it's origin, and needs to be free of any collisions. (they have huge helmets)

Link to comment
Share on other sites

Bring the hatch further out, that's all, it's too deep in. The pivot point for the hatch must allow for a kerbal to spawn outside of the door, if you pivot point is inside your main collider, you will get an obstruction.

You also don't need to model your physical colliders for the hatch or ladder. Create empty game objects in unity (align them as you have done) and then apply a physics Box collider to both parts, and make them convex and assign the part triggers as per normal.

Yes, the hatch needs to intersect with the main collider of the craft in some way - but not alot. most of my hatches barely touch the main collider and of course Blue arrow Z axis is the way the kerbal walks into the pod and green Y is facing up.

Link to comment
Share on other sites

My understanding and first-hand experience has been that the airlock and ladder colliders need to be convex, in addition to being Part Triggers.

I usually model them in Blender, assign mesh colliders to them in Unity and tick the convex option.

Make the hatch collider a large cube, about 0.5 units on a side, and stand it off the model's collider by about 0.2 units. It doesn't seem to work well if it's too small, especially in the Z dimension. Probably because the kerbal is spawned at it's origin, and needs to be free of any collisions. (they have huge helmets)
Bring the hatch further out, that's all, it's too deep in. The pivot point for the hatch must allow for a kerbal to spawn outside of the door, if you pivot point is inside your main collider, you will get an obstruction.

You also don't need to model your physical colliders for the hatch or ladder. Create empty game objects in unity (align them as you have done) and then apply a physics Box collider to both parts, and make them convex and assign the part triggers as per normal.

Yes, the hatch needs to intersect with the main collider of the craft in some way - but not alot. most of my hatches barely touch the main collider and of course Blue arrow Z axis is the way the kerbal walks into the pod and green Y is facing up.

Thank you all for the info, I used a combination of all your suggestions to get the hatches working on both my currently textured models. Screenshots and explanation of what i did to fix it are in the original post. Thanks again all, at least i know how to go about troubleshooting and fixing the hatches better now.

Link to comment
Share on other sites

  • 2 weeks later...

I'm bumping this thread in the hope of getting a bit more help.

After getting the hatches working on 2 of my models, the other 4 I've now done don't work, I'm continually getting "hatch is obstructed" message, it seems no matter what I try in terms of positioning I can't get it working, not only that but the steps that worked for me on the first two models no longer seem to bring any results, I've checked and double checked triggers, layers, convex flag for the colliders it all seems to be correct, but alas, it's not working, and I've spent more than a few hours now adjusting positioning of the colliders trying to get them to work.

I would like to know if anyone else has had lots of trouble getting their hatches to work.

I'd also like to know if someone would be willing to have a look at the unity files for my models and see if they can get the hatches working.

Link to comment
Share on other sites

  • 4 weeks later...

got almost the same matter a few day ago with welding stock part via config edit: i can confirm a decal of 0.5 seem to be ok, same for some rotation and scaling around the shared coordinate origins, different origin overlaps is very important as TT explained very well in his tuto

The part in itself (watch for notes)


PART
{
name = wak-mmb-command03
module = Part
author = Squad, WinkAllKerb'

MODEL
{
model = Squad/Parts/Command/[B]landerCabinSmall[/B]/model [COLOR="#FF0000"]model used for the hatch collider (must be the first model with a hatch in the hierarchy)[/COLOR]
position = 0, 0 ,0.05 [COLOR="#FF0000"]slighty translated[/COLOR]
scale = .75, .625, 1.125 [COLOR="#FF0000"]scaled not to interfer with internal/iva camera[/COLOR]
rotation = 44, 0 , 180 [COLOR="#FF0000"]rotated to fit the model + not to interfer with internal/iva camera[/COLOR]
// parent = anotherModelTransform <---------Not necessary unless Second or subsequent part.
// texture = model000 , Squad/Parts/Command/cupola/model000
// texture = model001 , Squad/Parts/Command/cupola/model001
}

MODEL
{
model = Squad/Parts/Command/Mk1-2Pod/model [COLOR="#FF0000"]model used to fit the iva/internal camera origin (pos, scaling and, rotation have to be reported to the iva with transform[/COLOR]
position = 0, 0 , 0.050 [COLOR="#FF0000"]translation[/COLOR]
scale = .95, 1, .95 [COLOR="#FF0000"]scaling[/COLOR]
rotation = 20, 0 , 0 [COLOR="#FF0000"]rotation[/COLOR]
// parent = anotherModelTransform <---------Not necessary unless Second or subsequent part.
// texture = model000 , Squad/Parts/Command/Mk1-2Pod/model000
// texture = model001 , Squad/Parts/Command/Mk1-2Pod/model001
// texture = model001 , Squad/Parts/Command/Mk1-2Pod/model002
}

MODEL
{
model = Squad/Parts/Utility/CircularIntake/model
position = 0, 1.10 , 0.45
scale = 1.1, 1.33, 1.1
rotation = 20, 0 , 0
// parent = anotherModelTransform <---------Not necessary unless Second or subsequent part.
// texture = model000 , Squad/Parts/Command/Mk1-2Pod/model000
// texture = model001 , Squad/Parts/Command/Mk1-2Pod/model001
// texture = model001 , Squad/Parts/Command/Mk1-2Pod/model002
}

MODEL
{
model = Squad/Parts/Electrical/batteryBankLarge/model
position = 0, 0, 0
scale = 0.9725, 1, -0.965
rotation = 0, 0, 0
// parent = anotherModelTransform <---------Not necessary unless Second or subsequent part.
// texture = ? , Squad/Parts/Electrical/batteryBankLarge/?
// texture = ? , Squad/Parts/Electrical/batteryBankLarge/?
}

MODEL
{
model = Squad/Parts/FuelTank/MK1FuselageStructural/model
position = 0, -0.5 ,0
scale = 2.387, 0.5 , 2.41
rotation = 0, -90, 0
// parent = anotherModelTransform <---------Not necessary unless Second or subsequent part.
// texture = model000 , Squad/Parts/Utility/dockingPortLarge/model000
// texture = model001 , Squad/Parts/Utility/dockingPortLarge/model001
}

MODEL
{
model = Squad/Parts/Structural/structuralIBeam1/model
position = 0, 1.1, 1.1
scale = 0.33, 1.9, 2
rotation = 0, 0, 90
// parent = anotherModelTransform <---------Not necessary unless Second or subsequent part.
// texture = model000 , Squad/Parts/Structural/structuralIBeam1/model000
}

MODEL
{
model = Squad/Parts/Structural/structuralIBeam3/model
position = 0, .35, 1.1
scale = 0.25, 1, 1.25
rotation = 0, 90, 0
// parent = anotherModelTransform <---------Not necessary unless Second or subsequent part.
// texture = model000 , Squad/Parts/Structural/structuralIBeam3/model000
}

MODEL
{
model = Squad/Parts/Utility/sensorAccelerometer/model
position = 0, .9, 1.125
scale = 1, 1, -1
rotation = 0, 0, 0
// parent = anotherModelTransform <---------Not necessary unless Second or subsequent part.
// texture = model000 , Squad/Parts/Structural/structuralIBeam3/model000
}


MODEL
{
model = Squad/Parts/Electrical/RTG/model
position = 0.20, 0.675, 1.1
scale = 1, 1, 1
rotation = 0, 30, 0
// parent = anotherModelTransform <---------Not necessary unless Second or subsequent part.
// texture = model000 , Squad/Parts/Electrical/RTG/model000
}

MODEL
{
model = Squad/Parts/Electrical/RTG/model
position = -0.20, 0.675, 1.1
scale = 1, 1, 1
rotation = 0, 30, 0
// parent = anotherModelTransform <---------Not necessary unless Second or subsequent part.
// texture = model000 , Squad/Parts/Electrical/RTG/model000
}


MODEL
{
model = Squad/Parts/Utility/spotLight1/model
position = 0, 1.325, -.175
scale = .65, .65, .65
rotation = 35, 0, 180
// parent = anotherModelTransform <---------Not necessary unless Second or subsequent part.
// texture = model000 , Squad/Parts/Utility/spotLight1/model000
// texture = model001 , Squad/Parts/Utility/spotLight1/model001
}

MODEL
{
model = Squad/Parts/Utility/ladder1/model
position = 0, 0.275, -.975
scale = 1, 1, 1
rotation = 0, -90, -44
// parent = anotherModelTransform <---------Not necessary unless Second or subsequent part.
// texture = model000 , Squad/Parts/Utility/ladder1/model000
}

rescaleFactor = 1

node_stack_right1 = 1, 1.1, 1.1, -1, 0, 0 , 0
node_stack_left1 = -1, 1.1, 1.1, 1, 0, 0 , 0

node_stack_bottom = 0.0, -0.875, 0.0, 0.0, 1.0, 0 , 2

cost = 3550
category = Pods
subcategory = 0
title = M.M.B. Peggy'12-s Command Module
manufacturer = Dyogenn Kerman Shipyard Combobulator Parts Co.
description = Wow !!! Every train need a locomotive same goes for the "Modular Mobile Base". Feel free to choose between our models, we guarantee no ears smoke. (Cost, Mass & Breaking Resistances include a 4 Strut Connectors equivalence)
// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
attachRules = 1,0,1,1,0

mass = 3.65
dragModelType = default
maximum_drag = 0.3
minimum_drag = 0.35
angularDrag = 3
crashTolerance = 9
breakingForce = 800
breakingTorque = 800
maxTemp = 2900
fuelCrossFeed = True

vesselType = Base

// --- internal setup ---
CrewCapacity = 3

INTERNAL
{
name = PeggyInternal [COLOR="#FF0000"]customized iva[/COLOR]
}

MODULE
{
name = ModuleSAS
}

// --- Electric Generator setup ---
MODULE
{
name = ModuleGenerator
isAlwaysActive = true
OUTPUT_RESOURCE
{
name = ElectricCharge
rate = 1.5
}
}

// --- command setup ---
MODULE
{
name = ModuleCommand
minimumCrew = 1

RESOURCE
{
name = ElectricCharge
rate = 0.4
}
}

MODULE
{
name = ModuleReactionWheel

PitchTorque = 5
YawTorque = 5
RollTorque = 5

RESOURCE
{
name = ElectricCharge
rate = 0.1
}
}

// --- Resource setup ---
RESOURCE
{
name = ElectricCharge
amount = 4000
maxAmount = 4000
}

// --- Light setup ---
MODULE
{
name = ModuleLight
lightName = spotlight
useAnimationDim = true
lightBrightenSpeed = 2.5
lightDimSpeed = 2.5
resourceAmount = 0.04
animationName = LightAnimation
useResources = true
}

// --- sensor setup ---
MODULE
{
name = ModuleEnviroSensor
sensorType = ACC
}

// --- Air Intake Setup ---
MODULE
{
name = ModuleResourceIntake
resourceName = IntakeAir
checkForOxygen = true
area = 0.008
intakeSpeed = 10
intakeTransformName = Intake
}

RESOURCE
{
name = IntakeAir
amount = 0.2
maxAmount = 0.2
}

}

notice that the main hatch is the first one that is used to enter and exit + in game part eva menu, the other hatch from the second model can't be used to exit and not seeable in menu in game but when close to it you can enter

The welded iva (very basic atm)

INTERNAL
{
name = PeggyInternal

MODEL
{
model = Squad/Spaces/PodCockpit/model [COLOR="#FF0000"]model used[/COLOR]
position = 0, -0.05, 0 [COLOR="#FF0000"]translation including transform specific to iva[/COLOR]
scale = 0.95, 0.95, 1 [COLOR="#FF0000"]scaling also taking care of the specific iva transform[/COLOR]
rotation = -20, 0, 0 [COLOR="#FF0000"]same for rotation[/COLOR]

}

MODULE
{
name = InternalSeat
seatTransformName = BottomSeat
}

MODULE
{
name = InternalSeat
seatTransformName = RightSeat
}

MODULE
{
name = InternalSeat
seatTransformName = LeftSeat
}

MODULE
{
name = InternalCameraSwitch
colliderTransformName = focusLeftWindow
cameraTransformName = LeftEyeTransform
}
MODULE
{
name = InternalCameraSwitch
colliderTransformName = focusRightWindow
cameraTransformName = RightEyeTransform
}
MODULE
{
name = InternalCameraSwitch
colliderTransformName = focusLeftSideWindow
cameraTransformName = LeftSideEyeTransform
}
MODULE
{
name = InternalCameraSwitch
colliderTransformName = focusRightSideWindow
cameraTransformName = RightSideEyeTransform
}


}

So yup yup it all as to do with merging/rotate/scale InternalCamera&iva, main part, & hatch origin to get it work near 0,0,0 for position + taking care of any collider that can obstruct the hatch (some part with mesh collider kinda different from the model mesh in itself can be a little bit anoying regarding this: some conic part with a cube collider for example ;) )

Edited by WinkAllKerb''
Link to comment
Share on other sites

I had similar issue with the airlock hatch, it was always obstructed and absolutely refused to work unless I put the collider for the airlock far away from the module. That is, until I figured out that marking Layer 21 'Part Triggers' is not enough by itself, I had to select it from the layers pulldown menu once defined. After that, it worked on the first try without any problems.

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