Performance issues when moving 2D colliders by code.

Hi, I am making a 2D ball and paddle game, similar to breakout/arkanoid.

Some of my blocks move side to side, spin around their own pivot or rotate around a point.
Their Rigidbodies2D are marked as kinematic and fixed angle, since all I want is to detect the collision with the ball, I don’t want the ball to be able to push them.

The static ones work great, but the ones that move, specially the ones with more than one collider and the ones with polygon colliders instead of circle/box simple shapes, cause a huge performance drop. I’ve tracked it down to “Physics2D.XXXColliderCreate” (where XXX is the collider type). So it seems that every time I change the position or rotation of the gameobject by code, the collider (or colliders) is created again.

I have tried changing the code from a “Transform.RotateAround” to a “Tansform.Rotate” and a “Transform position = X”, it doesn’t solve the problem.

I have alto considered making them non Kinematic and moving them through physics, but the math to get the same movement is way more complicated and even if I make the ball ultra light and the blocks ultra heavy, they will still move a little.

I am quite surprised by this problem, since what I need to achieve is rather basic.
Is there any way to get detect collisions between two objects, one moved by code and the other one affected by physics?

Set your rigidbodies as kinetic, use rigidbody.MovePosition() and rigidbody.MoveRotation().