Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Top down Camera behavior

Discussion in 'Physics' started by GrandWaazoo, Jan 28, 2015.

  1. GrandWaazoo

    GrandWaazoo

    Joined:
    Mar 2, 2014
    Posts:
    22
    Hello,

    I have a camera with a top down view, like for a RTS game. The movement of this camera is provide by a drag and drop movement with the mouse (like google maps for example). I want to constraint where the camera can go, with some invisible walls.

    I don't know how I can smoothly constraint my camera. Because with some box colliders (for the invisible walls, and a sphere collider for the camera) the collision is not smooth, its trembling, and I don't see exactly how to do it. If someone have an idea ...

    Thank you !
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Have you tried using a CharacterController for the camera movement instead of a rigidbody with a sphere collider? This will allow you to move the camera with a certain speed and it will be blocked by colliders but will not have normal physical behaviour (such as bouncing off a collider, etc).
     
  3. GrandWaazoo

    GrandWaazoo

    Joined:
    Mar 2, 2014
    Posts:
    22
    Ok it works now thanks.