Hey guys, i have a 2d gameobject whicht privot point i have changed in its sprite renderer. Also in the editor i chose pivot and not center.
I for my gameobject to be only able to rotate around its privot point, like in the picture. After the collision the orange gameobject rotates around its pivot point.
This should do what you want:
transform.RotateAround(pivotPoint, Vector3.forward, 20 * Time.deltaTime);
That is rotating around the pivotPoint which you need to provide as a Vector3. Since you are in 2D, give the x and y floats and give the z float 0 for your pivot point. Vector3.forward just makes it rotate around the z axis. It is rotating at 20 degrees per second.
Cheers