Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

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.