Hi
I have a few design questions that I am having trouble understanding.
The first is about third person cameras. Currently I have a camera following my main character in third person but I noticed the camera clips through objects instead of dodging them. How exactly would I tackle this issue?
The second is about rendering objects in distances that will never be reached in the level.
Currently my scene looks like this:
The grey area behind the scene will never be reached, how exactly would I make this area not visible? The grass will be covered with more trees but the grey area will still be visible then, What would be the best way to cover it up (I was thinking I would have to use trees for as far as the rendering distance of the camera)?
Thanks
For the second problem… if your game scene is static all the time as in the picture, you can simply set the background color as the same as the green terrain.
But if the game is in a city or world, I like to use fog to hide distant objects: if the character reach the game border, Should be more terrain where the player cannot access, so you can make like… 100 meters of terrain in your game, with as less detail as possible(maybe with some trees) and set the fog with less than 100 meters of distance.
And for grand finale, you can put an skybox with the same color as the fog.
1 Like
You can also use two cameras for the distance part, at different scales with rotation linked.
For the first, there are a few ways to do it. Multiple cameras using clip plane or custom shader, or using a collider on the camera to prevent penetrating. (I think the unity third person rig has this option)
@zombiegorilla
I hadn’t realised there was a third person camera in the assets, It has a prevent wall clipping script which I have used and works perfectly! Thanks.
@diegomendes
I will have a go at implementing something like you’ve said. For the fog is there a prebuilt shader that does fog or should I write my own?
Thanks
Using Fog is as simple as you can think! In Unity, go to Window > Lighting, there you will find the fog settings.
Here you can learn some good things about light, skyboxes and fog: