I have a small problem and it would be very helpful, which could guide me. What happens is the following, I have an enemy (evil usb) in my scene, to the collisionar this enemy with my main player threw the enemy always right falling down the map. All right up here, what I need now is to know that exact point I'm colliding my enemy to know if I should throw it to the right or left depending on the point of collision which can be at the Centre to the right or to the left of my enemy like this imagen:
I read something about contact point, but can not understand how it works and really serves me, here is the code that I have to collision and throw it to the right:
void OnCollisionEnter(Collision other){
if (other.gameObject.CompareTag ("Inacapin")) {
enemyrigid.AddForce (-transform.right * 500, ForceMode.Acceleration); // work fine
/*if(point of collision right){ // I need something like that
enemyrigid.AddForce(-transform.right * 500, ForceMode.Acceleration);
}else if(point of collision left){
enemyrigid.AddForce(-transform.left* 500, ForceMode.Acceleration);
}else{
enemyrigid.AddForce(transform.forward* 500, ForceMode.Acceleration);
}
}
}
hope they can help me, thank you... ;)