In one of my projects, I’ve a player vehicle (actually a miniature submarine inside a human body) whose motion is entirely handled by script, without any use of the physics engine. I would like to achieve two things:
-
I don’t want, under any circumstances, the physics engine to mess with my submarine. I handle the physics for myself, thank you.
-
For collisions with obstacles, I would like to use OnCollisionEnter and OnCollisionStay rather than OnTriggerEnter and OnTriggerStay, because unlike the latter ones, the former methods allow to retrieve the actual collision points. (Only knowing that the submarine collided, say, with the heart doesn’t help, as the heart is the whole level.)
Unfortunately, the OnCollision… methods are for some obscure reasons only called when the submarine is not kinematic, so I can’t achieve 1) by checking the “Kinematic” checkbox. (Well, there is a “freeze rotation” checkbox, but unfortunately no “freeze position” checkbox.) In other words, if I want to know where a collision occurs, I have to allow the Physics engine to mess with my submarine…
Dura lex, sed lex.
Hence my question: Does anyone know a trick to discourage the Physics engine from moving my submarine, without declaring it as kinematic? Maybe setting the mass to a tiny value, or the drag value to an insane value? Maybe resetting the position of the collider in each Update or FixedUpdate? Or switching “kinematic” on and off at the right moment? Or something else?
Or maybe should I wait for Unity 3? :roll: