stdout
stdout

Reputation: 1779

Stop camera from seeing inside objects

I'm new to Unity and to the Vuforia SDK. How do I stop the camera from passing through an object and "seeing" the inside when the user gets very close to the target?

Upvotes: 2

Views: 4429

Answers (1)

cnsumner
cnsumner

Reputation: 533

Basically the reason this happens is because the camera is not a physics object, so it has no collisions. So, what you need to do is create an empty and give it a box or sphere collider (sphere is probably better in most cases), you can then set it's position to the same as the camera and parent the camera to the empty. This way, the camera will get the collision effects of it's parent empty.

If after this the camera can still "see" through the object, you may need to set near clipping planes to 0.1.

You might also be able to give the camera itself a collider sphere or box directly (without using an empty), but I have not tested this.

There is a similar question on answers.unity3d.com -> link

Upvotes: 1

Related Questions