The camera passed through the model and entered the interior of the model

when i zoom the camera ,it passed through the model and entered the interior of the model.
Can this situation be avoided?

Hi @koolou,

You can fix that by selecting your active camera and in the inspector reduce the Near Plane property to something smaller.

That way the camera clipping planes will render models closer to the camera.

1 Like

Thanks for your reply, I have set the value to 0.01, but it still doesn’t work.
which i want is :when zoom in the camera view, the view can’t enter the model, i need
to keep the user always look at the outside of the model

Maybe you are looking your models from behind? If that’s the case try setting culling to None in your model materials.

You can find that in the Other panel at the bottom of the inspector panel, when selecting a material.

Or maybe I misunderstood what you are trying to do.

If your goal is to stop the camera from entering the model then you need some form of detecting when that happens. The simplest thing would be to set your orbit camera minimum distance to a larger number (you can find that on the orbit camera script component).

More complex ways would be to detect for collisions with the model.

1 Like

Is there any way to detect whether the camera and the model collide? The model is a shoe,and the camera needs to be as close to the model as possible, so that the user can see the details of the model.
but also need to stop the camera entering the model.

Sure, check this tutorial on how to setup collision and trigger volumes:

I have followed the tutorial to create a test project.
Added a console.log in the trigger.js, but when the camera collides with the model, this line of code is not executed.
Could you please help me to check this?

Finally, after set the rigidbody.type to kinematic, the trigger works !

1 Like