- Home /
Character controller / terrain collider - am I misunderstanding these?
My character moves through the terrain (like a ghost) despite having a Character controller...
Although I've searched Unity answers and elsewhere for quite some time now, I can't make it work.
My character has a character controller and a script that moves wherever I click (x and z axis only). My terrain has the comes-with terrain collider (it's trigger is off).
The character moves fine, but will go right through mountains if they lie in its path - no collision. However, if I add a cube (box collider + rigidbody) to the scene, the character bumps it and moves it.
If I add a rigidbody to the character, it falls through the terrain.
I can remove the Character controller and go the collider+rigidbody route, but then the mesh bounces, is too affected by gravity, etc. Plus, I'd really to figure out what I'm doing wrong.
Thanks in advance.
Answer by alen · Apr 11, 2011 at 01:03 AM
you can try this script , or if allredy exist change it using UnityEngine; using System.Collections; public class IgnoreCollider : MonoBehaviour { public Collider otherCollider; void Start () { Physics.IgnoreCollision(transform.collider, otherCollider, false); } }
Your answer
Follow this Question
Related Questions
Character Controller Slope Limit on Terrain 0 Answers
3rd person character controller walking down hill 1 Answer
Mecanim Locomotion Starter Kit & Terrain Issues 1 Answer
Character floating after walking up higher terrain/object 1 Answer
CharacterController makes player game object fall through generated terrain. 1 Answer