there’s two game objects in question here. the ship(player) and the bouncer(wall that acts like a rubber barrier).
here’s the script that makes the wall bounce the ship backwards.
function OnTriggerEnter (other : Collider){
if (other.name == "Ship"){
Repel (other.gameObject);
}
}
function Repel (other : GameObject){
var shipRepelSpot = other.transform.position + transform.TransformDirection(Vector3(-3, 0, 0));
iTween.MoveTo(other, shipRepelSpot, 0.8);
}
basically what’s happening is when the ship hits on side of this bouncing wall, it gets repelled properly. On the other side, however, the ship kinda squeezed through the wall in an awkward motion. I just want to know why would one side be behaving differently on the same object. I’ve checked the collider size. The ship/player is the trigger and has a rigidbody, the bouncing wall just has a collider.