Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Limiting CharacterController?

Discussion in 'Scripting' started by Spacemonkey, Jun 27, 2009.

  1. Spacemonkey

    Spacemonkey

    Joined:
    Oct 24, 2008
    Posts:
    89
    Hello,

    Got a newbie question for youse. I'm doing a 2D platform thingy where a character runs around on a 2D plane and has a camera following it. The camera is set to follow a child object of the player prefab and the child's position is offset from the player's by a certain distance at all times.

    Now; when the player reaches the far end of the scene I want the child object to collide with an invisible wall so the camera doesn't move outside the scene-bounds, but the player (with a CharacterController attached) itself should be able to pass through it. Is there a way to limit the CharacterController so it only collides with special (tagged?) objects?