How to make ball sticky

So I am making a drag and shoot game where you have to make the ball stick to walls to make it to the end of levels and I was wondering if anyone could tell me how to make my Rigidbody2D ball attach itself to 2D Colliders like walls when the ball comes in contact with it.

When they are collides,set the ball rigidbody’s isKinematic attribute to true.

void OnCollisionEnter(Collision col)
{
 if(col.tag=="stickywall")
     myRb.isKinematic=true;
}

If you want move object with what it sticks to,set stickyObject the ball’s parent.

myObj.transform.parent=stickywall.transform;