- Home /
How do I set up colliders and rigid bodies in a Descent space shooter?
Three days of reading posts and docs and experimenting and I am just out of mojo. This should be the very most basic thing for a 3D engine to do, and I am just Fail.
I have a ship I drive by setting position and rotation (I have specific rolling and straightening tricks to do with the stick in neutral so I don't want physics). I have a death star I am inside of. I have hoops I want to fly through attached to the inside.
Okay, so the ship is definitely a collider-rigidbody-kinematic. No combination of collider, rigidbody, kinematic, fixed joint, no grav, parent-child, magic spell, or monkey whistle makes the other two behave. Mostly I fly through everything, but sometimes I knock hoops free of the wall and one time (most hilariously) I thought it was working but I was actually pushing the death star around from the inside.
1) Am I correct the ship is collider-rigidbody-kinematic? (And is that Update or FixedUpdate?)
2) What is the setting for "Big mesh that never-ever-just-be-like-terrain moves that you bounce off of."
3) What is the setting for "Thing attached to that big thing that has a trigger attached to it like a hoop on a stick."
4) And for extra credit, if I wanted to use terrain for a planet level or something, would these answers still hold?
generally, don't use mesh colliders.
in video games you (the Video Game Engineer!) carefully constructs colliders from the primitive colliders (box, sphere) so that they match reasonably the object. enojy!
Answer by whydoidoit · Oct 17, 2012 at 10:27 PM
Mesh colliders can only collide with other mesh colliders if they are both convex. No chance of your space station being convex I'd guess.
I'd make your spaceship out of primitives (use multiple if you need to, as child game objects of the ship).
Ship is just a sphere collider with a kinematic rigidbody right now. I do have the placeholder station as a mesh collider.
(I will later be asking if it should remain one big mesh collider or if it would be better to break it apart and parent the pieces back together, but that is for later.)
$$anonymous$$esh colliders have a bunch of weird things about them. They are also subject to back face culling - but I'd guess that isn't your problem as your spaceship is the focus. $$anonymous$$inematic rigidbody on the mesh collider is another idea. Is it moving?
The station does not move. It is like the map's terrain in functionality. Station as $$anonymous$$-R doesn't work, but at least it isn't supposed to work.
http://docs.unity3d.com/Documentation/$$anonymous$$anual/Physics.html
I'm starting to think $$anonymous$$eshCollider doesn't do anything. $$anonymous$$ade an invisible wall as a Plane and flew right through it. $$anonymous$$ade an invisible wall as a thin cube with a BoxCollider and I bounced off ($$anonymous$$e as R-C and it as C.)
$$anonymous$$esh colliders only work in the direction of the normal too.