- Home /
camera detecting walls
Hi there. I have a camera with a boxCollider that is there to detect walls, but every time I hit a wall my 3rd person controller just stop in its track.
How can I my make the camera move inwards or move out of the way every time I get close to a wall. I have tried using ray casting and Mathf.Lerp but I don't know if I am doing the Right thing. I just starting to get a good sense of using java script but I'm not the best scriptwriter.
If anyone can help me out, I'll deeply appreciate it.
Answer by nventimiglia · Feb 14, 2013 at 07:16 AM
When I use a third person camera, I have a script which checks for a blocked view. The script runs a raycast from the player to the camera, if it hits anything I move the camera in.
how do you do it? I'm really struggling with the script.
Your answer
Follow this Question
Related Questions
RaycastHit: What is the difference between hit.transform.tag and hit.collider.tag? 1 Answer
Difference between hit.collider.gameObject vs hit.transform.gameObject 2 Answers
Detect RaycastHit on Character Controller 2 Answers
Logic to detect objects entering between the player and camera? 1 Answer
Raycast exit point of collider 0 Answers