Detecting 'Collisions' Without Physics

Okay this is something I thought would be VERY straightforward…

…I have of course the Main Camera attached to the CharacterController, and a level filled with BoxColliders

…I have ‘leaning’ in the game, and what I want to do to prevent clipping though the level geometry when the camera ‘leans’ over (since it is then outside the CharacterController volume during this action) is to detect when the camera is touching the BoxColliders. I’d then stop the leaning action if the camera is indeed in contact with a collider…

…I understand all the wackiness regarding one of the elements involved in the collision having to have a RigidBody attached, but this isn’t feasible in this situation. The Camera can’t and shouldn’t have one, and the level BoxColliders shouldn’t as they are PURELY for preventing the player from going where he shouldn’t and it would be wasteful (especially for iPhone) to make ALL the colliders rigidbodies just for this singular purpose (not to mention they move).

I’m rather surprised that there seems to be no way to simply detect when two objects are touching without the overhead of the physics engine? Am I understanding this correct and are there ANY alternatives?

Thanks again.

-Steve

Ooooh…the key is Is Kinematic

…created a Sphere Collider and positioned center to the MainCamera(same child level as well)…
…made the new collider a Rigid Body and checked Is Kinematic

…and voila, the Sphere Collider moves along nicely with my leaning code, and now I can detect collisions with my level BoxColliders!

Phew… :smile:

-Steve