Hello Friends . I am using character controller for my character . now , i am confused about the death of my character when it collides with something . Currently i am using following code …
function OnControllerColliderHit(hit:ControllerColliderHit){
var hitPoints:Vector3=transform.InverseTransformPoint(hit.point);
var diff=hit.point-transform.position;
if(diff.z>=.5){ // .5 is radius of Character Controller
Camera.main.GetComponent(mainController).isPlay=false;
}
}
But , its not working properly . Please tell me where i am wrong and guide me in correct direction . ![]()