- Home /
Prevent third person controller seeing through objects and terrain
Hi all,
I am currently using the third person controller which ships with unity, and is working fine except for the problem stated in the title. I have researched this for some time, and people have said changing the clipping plane on the main camera should do the trick....but it does not work for me; and this also makes the movement really jittery.
Could someone please point me in the right direction please....Thanks!
What does seeing through objects mean? When do you get that?
Well basically if i get close enough to an object, and then turn the camera it clips through the walls etc...Whereas I want the camera to stop moving if it gets close to a wall if that makes sense
You will need to enact some form of controller on the camera to prevent issues. There are a few scripts online to do this for you.
Ah ok, do you know of the site where i can find some of these scripts?
Answer by TonyLi · Jul 15, 2013 at 01:59 PM
Try this camera controller: http://wiki.unity3d.com/index.php/SmoothFollowWithCameraBumper
Or choose from a list of options: http://wiki.unity3d.com/index.php/Scripts/Controllers
Or write your own using 3DBuzz's tutorial: http://www.3dbuzz.com/forum/threads/186940-Unity-Creating-a-Custom-3rd-Person-Character-System-Drop-ONE
Right ok, should the target be the third person controller? and also should I put the script on the main camera? Thanks
From the SmoothFollowWithCameraBumper script documentation:
Place this script onto a camera and select camera target in Inspector.
So, yes, the target is your third person controller, and the script goes on the main camera. When the script starts, it will move the camera to be a child object of the target (i.e., of your third person controller).