playMaker

Author Topic: Orbit Cam With Collision And Adjustment  (Read 1457 times)

sandEboy

  • Playmaker Newbie
  • *
  • Posts: 39
    • GraspTech
Orbit Cam With Collision And Adjustment
« on: January 13, 2017, 08:09:46 AM »
I used the simple method of having an empty rotate with mouse look, and the main camera as a child to look at the empty. Simple orbit camera set up. Now I need the camera to detect obstructions and readjust. To achieve this, I have the target of the cam (who or what the camera is watching/orbiting) cast a ray towards the camera, whereby if it reaches the camera without any obstructions whatsoever, it will remain as is. But if it hits something before it reaches the camera it will switch to a state where the camera should jump to the position where the collision occurred.

So far, I'm getting the state to seamlessly switch whenever the ray hits something before the camera. But how can I store the information of the point where the ray hit and move the camera to that position?