playMaker

Author Topic: Script Controlled Camera and Wall Collision  (Read 1313 times)

acornbringer

  • Junior Playmaker
  • **
  • Posts: 75
    • Acornbringer.com
Script Controlled Camera and Wall Collision
« on: November 29, 2016, 02:41:13 PM »
Hi there!

I'm using this http://wiki.unity3d.com/index.php/MouseOrbitZoom to controll my camera and I need the camera to not pass through colliders I created in the scene when it's being moved around.

(The script uses a pivot point for the camera to rotate, zoom, and pan.)

I tried using raycast actions to detect when it hits a collider and told the camera to "I Tween Move By" in the opposite direction however it seems like the script that moves the camera around in the first place keeps other elements from moving it because when I remove the script, I can see the camera push in the direction I entered.

Before using raycasts, I tried using colliders on the camera but the script seems to override the physics as well.

Is there some other way this is possible or would I need another camera setup?

Thanks!