Jump to content

(Solved) What's wrong with my colliders?


Recommended Posts

Hello guys,

Is anyone familiar with this Kerbal behavior when he's standing on a part?

At first I had another issue where a Kerbal would get stuck in a falling animation as soon as he stepped on my part.

SaSaVkDm.png

I went and split all the curved colliders into flat plates. Now I get this jumping behavior.

I remove mesh renderer component and make mesh colliders with convex in Unity. Is that wrong?

Edited by Enceos
Link to post
Share on other sites

in general, you don't need convex colliders all around a hollow part - it's cool to have, but you don't need them and it'll produce more lag if you have convex meshcolliders..

a few small unity-primitives like sphere- or boxcolliders (much lower footprint) placed at the right locations will do the trick..

Why?

because mesh colliders (non convex) are for all but one situation sufficient.

so - you kerbal can walk inside a normal mesh collider as if it where solid walls..

The convex colliders are only for ground collision and one on each corner will be good enough for most hollow parts..

HTH

Edit: your first vid wasn't playing at first - I only saw the second..

This dancing effect has to do with a KSP issue (I call it bug)!

The dancing will stop right after you run your animation once in game..

load part, open doors, dancing stops..

The dancing is the kerbal who thinks, I have to fall over because I'm flying..

then he realizes he is standing - but the whole thing is starting over..

once the animation did run once, the game has initialized the parts colliders correctly and the kerbal can walk..

At least that is how I interpret that issue.. - I have it with all my LCARS vessels..

Edited by philotical
Link to post
Share on other sites

I'm using quite simplistic colliders. Are they bad?

aygX7OG.png

BTW, animating my hangar didn't work. The Kerbal is still dancing. Gonna try captain's advice and if no success will turn to Unity primitives.

Edited by Enceos
Link to post
Share on other sites

no, not bad - but more expensive then unity primitives..

I did it the same way at first and I removed about 60% of my lag by not using mesh colliders..

If you addComponent physics/boxcollider in unity to this part, you will get a box that is usually the right size from start..

It's an easy replacement..

an other hint - unity hates thin flat colliders..

the less ratio you have between height,lenght and width, the stronger your convex will be..

heavy parts, need a thick collider or they explode, get thrown in escape trajectory, destroy the planet or your part is considered debris and removed by KSP when landed => even with kerbals and command module in it!!

The Debris removal is glitchy and sensible to thin colliders as I had to learn the hard way.. - 60+ Kerbals lost

So - in my experiance,you should put 8 large sphere colliders on it, in each corner one..

Don't hesitate to let them overlap the model to reach a big enough volume - it's less important in gameplay that the convex collider fits perfectly than the question of having the part removed as debris all the time..

It's a balance between realism and efficiency..

All those problems are here, because squad does not do hollow parts - they never tested it and never planned it and so we have to face additional issues if we do them hollow.

A fueltank in KSP is what the collider system is made for..

a hollow part is a combination of relatively flat walls - those are rather instable - more so, than the should be..

The geometry of your part is problematic - if your walls would be at least 3 times as thick, you "could" get away with it..

All my ships have now 2 meter thick ground floors to make room for the unity primitives - and for big, heavy objects, sphere colliders work more stable against the "debris removal glitch"..

my 2 cents..

Link to post
Share on other sites

I watched the second video and immediately saw something... looks like your kerbal dances cause unity can't decide which collider he's hitting. The door or the inside of the hangar tube. This will especially be if the door collider is marked "Convex" as the door is not actually a convex hull and unity will round off that little lip on the bottom on the inside.

If the door isn't convex then move it further down in the animation. You can see the base of the hinge clipping through the floor of the hangar. Move it down a little and it might be enough.

Make sure you host a rave before you do that. Your crew wants to dance!

Link to post
Share on other sites
I watched the second video and immediately saw something... looks like your kerbal dances cause unity can't decide which collider he's hitting. The door or the inside of the hangar tube. This will especially be if the door collider is marked "Convex" as the door is not actually a convex hull and unity will round off that little lip on the bottom on the inside.

If the door isn't convex then move it further down in the animation. You can see the base of the hinge clipping through the floor of the hangar. Move it down a little and it might be enough.

Make sure you host a rave before you do that. Your crew wants to dance!

The little thing on the floor is just a cosmetic sliding hinge which follows the door on Z axis, it has no colliders.

I'm happy with how the door works, cause Kerbals don't have to stand on it : )

Edited by Enceos
Link to post
Share on other sites

Manifolding my colliders didn't solve the issue. A friend of mine tells convex colliders are calculated only from vertices. Edges and faces are irrelevant.

Gonna try replacing the walls with Unity primitives now.

Link to post
Share on other sites
you can share the unity project if all else fails. thin box colliders generally aren't a problem.

Primitive colliders indeed worked like a charm. Now my Kerbal runs around happy.

Tip to everyone, if you ever need Kerbals walk on your part - use box colliders and other unity primitives.

Link to post
Share on other sites
I've never had a problem with walking on mesh colliders.

You have my .blend file, maybe you can figure out why my mesh colliers there behave this way? floors are simple 8 to 10 vertices blocks.

Link to post
Share on other sites
no, not bad - but more expensive then unity primitives..

I did it the same way at first and I removed about 60% of my lag by not using mesh colliders..

If you addComponent physics/boxcollider in unity to this part, you will get a box that is usually the right size from start..

It's an easy replacement..

an other hint - unity hates thin flat colliders..

the less ratio you have between height,lenght and width, the stronger your convex will be..

heavy parts, need a thick collider or they explode, get thrown in escape trajectory, destroy the planet or your part is considered debris and removed by KSP when landed => even with kerbals and command module in it!!

Given my last construct there appears to be some truth to this one

So - in my experiance,you should put 8 large sphere colliders on it, in each corner one..

Don't hesitate to let them overlap the model to reach a big enough volume - it's less important in gameplay that the convex collider fits perfectly than the question of having the part removed as debris all the time..

It's a balance between realism and efficiency..

I see this design as problematic, because what you are doing is moving all the attachment points obviously distant point, even the flat thin colliders on my object had the radial decouplers well off the sides of the object.

Why cant he use a combination of box and mesh colliders?

For the floor and ceiling just over the hallway, box colliders running the length that overlap with the side colliders, the side colliders made out of a pentagon with 2 "right angle" corners and 3 >90' angle corners.

Link to post
Share on other sites
I've never had a problem with walking on mesh colliders.

neither have I..

Why cant he use a combination of box and mesh colliders?

I have never said, he can't..

I said don't use mesh colliders as CONVEX!!

If that wasn't clear, my bad..

Mesh colliders are good for kerbals to walk on, for other parts to hit on, but they will fall through the terrain when landed..

this terrain problem is the only reason for convex colliders and it can be solved with the 8 corner-spheres or boxes!

No need to have the whole part in convex colliders..

every mesh should be a mesh collider except it's a passable forcefield or so..

but non of them should be convex.

I hope that clears it up..

Link to post
Share on other sites

I wonder what's better, using a mesh collider on my floor and 4 sphere colliders on each corner or just using 3 box colliders...

-- updated --

I found that some mesh colliders work while other don't, no matter convex or not.

My model has 2 pairs of mesh colliders on the roof and walls and Kerbals interact with them without any problems. Had to replace everything else with box colliders.

Edited by Enceos
Link to post
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...