Hi,
I’m new to Unity and really don’t understand scripting. I’m trying to make a maze game and have the camera see through the character’s eyes (a subjective shot). I would also like the camera to rotate or orbit around the character so the player can look around. However my camera keeps looking through the walls when I rotate it. How do I fix this?
2 Answers
2
Basicly you can do a Ray/Spherecast and See if there is a Wall in the Way your Camera is Moving. If so you got to recalculate the Direction the Camera wants to go (Hope your Math skills are good ;))
The Camera has also a Near and Far Clipping Planes that tells the Camera from where to where it will render if your Nearplane is lets say 2 then it renders everything 2 Units Away from the Camera.
And the Orbit thing look at the Standard package there is a orbit Script you can take it as a Base.
Thanks for the help but I was just being a noob and had to recalculate the normals of the walls in the maze.
If you made your walls with a plane, remember that planes only have one side to them. If you look at them from the other side, nothing will render, therefore you can see "through" the wall. This may or may not be your issue.
– Polinator