Camera collision with mesh object
I'm having an issue setting up collisions between a game object with a custom mesh (terrain) and my camera. Here is the situation: I have a dynamically created mesh which represents a landscape, and a camera which can be moved. I want the camera to be able to collide with the mesh so that the camera doesn't move through the landscape.
Here is what I've done:
Attach a rigidbody to the GameObject (Terrain) with the custom mesh, turned off gravity.
Created an empty GameObject (CameraController) with a rigid body.
Set CameraController to the same position as the camera.
Set CameraController as the parent of the camera.
I figured this would work, but my camera and CameraController object still passes through the Terrain object. What have I done wrong?
Your answer
Follow this Question
Related Questions
Is there any good sample code for shooting a projectile and collision detection? 0 Answers
Collision between objects not being detected 0 Answers
Rigid Body and Collision 1 Answer
Trigger Object is still moving objects? 1 Answer
player going through walls even though it has colliders and rigidbodies 0 Answers