why is one side of collider behaving different than the other

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.

You’re not using physic for the repulsion, only for the collision detection. The side isn’t relevant then.

However, I guess that the two walls are facing the same direction / have the same rotation. Which means that transform.TransformDirection will point inside for one, outside for the other.

Rotate the incorrect wall of 180 on Y.

var shipRepelSpot = other.transform.position + transform.TransformDirection(Vector3(-3, 0, 0));

needed to be changed to

var shipRepelSpot = other.transform.position + other.transform.TransformDirection(Vector3(-3, 0, 0));