I am building a pong game and I have a rigidbody2d on the paddle(which is a trigger). For wall collision I use ontriggerenter/stay to make is move away from the wall. It works fine when I use it in the beggining but then when I change the paddle’s scale, in game, it calls the function but has no movement.
switch(coll.gameObject.layer){
case Wall.Layer:
Vector2 tempV2.x = rigidbody2D.position.x;
tempV2.y = wallHitOffset -
(((BoxCollider2D)collider2D).size.x*transform.localScale.x/2) - 0.03f;
rigidbody2D.MovePosition(tempV2);
break;
}