- Home /
Camera collision
Hey im making a 3rd person adventure game but the fixed camera goes through scenery thats behind me eg: rocks and houses, how can i stop the camera passing though? i gave the camera a box collider and tried loads of other but it just wont work :( comments appreciated.
There is a good tutorial on 3D Buzz that I have been following. It covers the aspects of Camera Occlusion and Collision.
For the theory on how to deal with the camera and obstacles, watch a couple of their video's. The blackboard theory/overview discussions are really good. Website link : http://www.3dbuzz.com/vbforum/content.php?212
scroll down to : Section 3 - Enhanced Character and Camera Control : Part 11 - Occlusion and Collision Overview. (direct link : http://www.3dbuzz.com/vbforum/sv_showvideo.php?v=4915)
You could possibly simplify their method by just casting one ray between the player and the camera, if there is something in-between the two , move the camera closer.
hey @shinodan , reading your comment made me a very sad panda. I understand it's hard to write a good question if the root of the problem is confusing you. And sometimes it's just about who sees your question. Sometimes it's about the Title , or the Tags , or just in the question body if it seems too general (non-specific to a problem). Not posting any sample code or a link can also leave people wondering exactly what the problem is Specifically.
So I am going to look at all your questions , and see if I can help , or generate some interest for you.
This is just some helpful information on using this 'site, please don't take it too personally , as I have been copy-pasting this into ALot of questions recently.
I wish this was made clearer for new users, so just some tips on using this 'site (for ALL new users) :
How to accept an answer :
On the left-hand-side of the Answer box , there are the following icons :
: Thumb Up : Number (of votes) : Thumb Down : A Tick :
If an answer worked for you , click on the 'Tick' , it should now be highlighted in green. If you like an answer on Any question , you can click on the Thumb UP , it should now be highlighted in green , and the number of votes should rise by 1.
How to reply to an answer / post a comment :
To make a comment , USE the 'add new comment' button, a window then opens to type in. The answer fields are for ANSWERS, so unless you are answering your own question , DON'T write in an answer box. This helps the 'site work properly, especially when other people are searching for answers, and want to read answers , not comments.
IF your question changes slightly while commenting and reading comments , EDIT the original Question, so anyone reading from the beginning knows what you are asking.
This will make for a happy experience for everyone. I made mistakes starting on this 'site too, but everyone is helpful if you learn and change these habits.
Following these simple steps helps the website work , and other readers to find answers also.
Happy Coding =]
the FAQ appears at the top of the page : http://answers.unity3d.com/page/faq.html
also : http://answers.unity3d.com/questions/133869/how-to-ask-a-good-question.html
Answer by kolban · Apr 09, 2012 at 11:34 PM
Executing a search in UnityAnswers using the phrase "Camera Collision" seems to show a wide variety of answers to this question. In summary, it appears that a camera should have both a collider as well as having a RigidBody. See for example:
http://answers.unity3d.com/questions/8396/camera-collision.html
Answer by shinodan · Apr 11, 2012 at 03:35 AM
Thanks alucard! great link! Though Im goin to stop using unity answers, ive had a complaint about every question ive asked, thought this was a place of assistance, clearly experienced unity users get decent answers. and noobs get told to google it or search for it (something i do before asking anyway) whilst the questions may be very similar, i couldnt find specifically what i need, hencefourth, i posted my question, if thats not what this site is for then it really needs re-named.
Unfortunately, a lot of people on here normally give new users a bad name. Poorly formatted code, no effort to use a spellchecker, absolutely no information, bad and generally undescriptive title like "i need hlep!!!1", unrelated tags ("unity", "scripting"), and sometimes pretty authoritative, acting like they're your boss and you are the slave. I'm definitely not saying that's you, don't get me wrong.
The reason you might have had complaints is that it can often be hard to answer questions if vital details are left out and we are left guessing ... sure, you might have the best of intentions and you made sure to prepare everything beforehand ... it's just that, as I said, new users are given a bad name by people who really just don't even try.
But please, please, please don't get turned off of Unity Answers. This place is a gold$$anonymous$$e of information and if you know how to use it, it is nothing but beneficial. I've only been program$$anonymous$$g for 4 months or so, and I absolutely love this community. :)
By the way, I found your question was absolutely fine. It gave the information needed in a succinct way. :)
I hope that was reasonably clear ... and make sure you know that I wasn't trying to hate on you at all. :P
$$anonymous$$lep
Your answer
Follow this Question
Related Questions
Camera Help (WoW-like) 1 Answer
3rd person camera doesn't rotate as intended 0 Answers
How do I fix this jitter problem? 0 Answers
3rd Person Camera Problem 1 Answer