How do you rotate an object (uses rigidbody) around a different pivot point than the object’s own transform position?
Because the object is pretty long, rotating around the object’s transform (which we do in 90% of the time) looks bad in this one specific feature we have and we want to rotate around another point to make it look better.
If you’re using physics as you suggest then it’s not rotating around the Transform position, it’s rotating around the body center-of-mass. The Rigidbody2D position/rotation is written to the Transform.
In Addition to @MelvMay reply, I discovered this helpful information while developing Throw Control asset.
Rotation (Torque) & Center of Mass
There are some nuances with Center Of Mass when rotation.
Symmetric Mesh
If you use Mesh Collider for Throwing Game Object and your mesh is ideally symmetric, then it’s the perfect case and the game object will throw naturally.
Asymmetric Mesh
If you use Mesh Collider for Throwing Game Object and your mesh is asymmetric, then you will have unnatural throw behavior when rotation.
Solutions:
1. Custom Center of Mass. You can indicate Custom Center of Mass manually in the Editor. There is no magic function that calculates the right Center of Mass.
2. Simple Forms of Colliders. You need to use one or more simple forms of colliders (box, sphere, etc.) placing them on the same Throwing Game Object and along the straight line. So in this case, you will have the right center of mass & right rotation.
Convex Mesh (3D Only tip)
Unity allows you to use only convex mesh colliders. In some cases, it is not what you need because the collider by default can cover more space than the object itself in some points. In order to quickly & automatically get a convex mesh collider for complex objects, use Technie Collider Creator.
2D doesn’t use any of the components you’re referring to and I presume the Asset you’re referring to (advertising?) isn’t for 2D either so I’m not sure how it helps here.
It’s 3D only for now. But can you confirm that the principles (not components) for dealing with the Center Of Mass that described in my post suit for 2D?
Honestly, I don’t see how anything you posted is related to 2D. I’m not sure what “principles” you’re referring to either TBH.
Symmetic Mesh - Not related
Asymmetric Mesh - Not related
SimpleForms of Colliders - How is “throwing” related to this post? It doesn’t matter where the colliders are when you change the center of mass.
Convex Mesh - Not related
The user simply wants to offset the center of mass and it’ll work.
I wrote the whole integration for 2D physics and I still don’t see how it helps the user above (maybe they can determine if it does or not) but I think this is enough off-topic for this thread which isn’t about “throwing” from what I can see.
Throwing is just the Use Case in Physics when you can check how much naturally the Center of Mass is set for a specific object.
You can just remove “Throwing” term from that info (that I personally tested), applying only Rotation with Physics and setting the Center of Mass — what was needed for the asker.
I already told the user they can change the center-of-mass which is all that is required. I have no idea how you’re adding to this beyond trying to convince me that your asset store link is somehow related but the thread is already overloaded so it doesn’t matter at this point.