Using a parents rotation to update the chile rotation

'ello folks, I have a cube as a game object with slots which are essentially plus (+) signs. There are nine of these on each face (so 54 in all) and the player can freely rotate the cube in a fixed position. The peg is also in a plus shape so it looks like a perfect fit for the slot.

We have the ability to snap the peg in to position and that works fine. The only problem is, if the pegs rotation for example is set to 0,0,0 but the cubes rotation in 45,45,45 the peg won’t rotate to fit in the slot properly.

What’s the code needed to make the peg take the rotation of the slot? Something along the lines of rotation.parent?

Thanks

Cas

The easiest way is to preposition empty game objects in the slots that have the desired rotation and positions that are child objects of the cube. Then just parent your pegs to that.