2D Representation of what I’m trying to solve
Screen shot of the objects, the white points are the test join spots.
I’m trying to build a system where blocks (think toy blocks with specific join points) can be connected together as part of the game.
I’ve got a system where the blocks can be joined together in the GameObject Hierarchy.
But I’ve got stuck with aligning the rotation of the objects. This is being done in space and as such I can’t rely on the world space up aligning with the objects local space up.
I’m looking for a solution where the objects, after colliding, will snap in to an aligned rotation.
*Edit - I’ve uploaded the picture above to help describe what I am trying to do. The diagram is 2d but I need to work out who to do this in 3D.
Any help or ideas appreciated.


Thanks. I'm using a collider event but I don't quite understand how the normal of the collider helps because I can't predict the orientation of the other object - or if it's aligned regularly. I think I need to find a way to get the smallest amount of rotation for the two objects to be flush and then apply that rotation to the parent object?
– DSebJI just ran into a good Q&A with examples of some math to solve a similar problem: [walking on walls][1] [1]: http://answers.unity3d.com/questions/155907/basic-movement-walking-on-walls.html Maybe you can extrapolate something from this that works for your scenario.
– s_guy