- Home /
Using character controller insted of normal collider
hey everyone,
i am making small free kick game using kinect. i used openNI skeleton to control my character. i attached collider at feet to kick the ball(along with rigidbody and sphere collider) but when i kick the ball my foot goes through ball not colliding with foot.
so i use character controller to collide and it worked ..
but now i want to add force to ball while kicking.
here the script that i used but it's not working
var speed: int = 5;
function OnControllerColliderHit(hit:ControllerColliderHit){
Debug.Log("we hit an object");
if(hit.gameObject.tag == "ball"){
Debug.Log("we hit an object");
hit.rigidbody.AddForce(Vector3.forward * speed);
}
}
i tried this script on first person controller and it's working.
what m i missing here ??
i used sphere to add character controller, which are child of foot bone.
need help.
thanx regards.
Your answer
Follow this Question
Related Questions
Collider question 0 Answers
Reuse a collision 0 Answers
How to stop rotation of prefabs? 0 Answers
Character Controller Component Makes the Player Pass through Hills, Rocks, Trees, etc! 0 Answers