- Home /
Third person controller Collide with cube
I am trying to check collision between a rock(it's a cube scale: x=10, y=10, z=10) with my third person charactor(standard controller provided with Unity)controller that comes along with unity 3d. My cube have already assigned a rigid body. Third person controller have "charactor controller". The cube always move when the charactor controller collides with it.
Aim: When collide with rock, person stop its moving(dn't pass though th rock)
Answer by Jess.Loboz · Mar 04, 2014 at 06:10 AM
U can do it by, varying mass of rigid bodies. Apply more mass to the rock and less to the person.:P
Even try with Is kinematic option within rigidbody component:)
Answer by Hassan-Ali · Mar 04, 2014 at 07:43 AM
Write this code in any script that is attached on ThirdPersonController
function OnControllerColliderHit (hit : ControllerColliderHit) {
if (hit is something that should stop you)
stop character contoller
}