Question by
peteihabib · May 27, 2018 at 02:37 PM ·
prefabsrotation axisanchor
Rotation anchor won't move with prefab,Rotation anchor problem
So I have this prefab called zBlock (Making a tetris game), and I came upon this really awkward problem which I can't really solve on my own since I'm pretty much a beginner in Unity.
The block is rotating alright (90 degrees), but the problem is that the since the anchor is so far away from the block, the block is rotating at a really exaggerated distance away from the block and I'm not really sure how to move the anchor around.
Images: Normal (no rotation): https://i.imgur.com/KxRnIsd.png
90 degrees rotation: https://i.imgur.com/HkWWkoG.png
Code:`
} else if (Input.GetKeyDown (KeyCode.LeftArrow)) {
//rotate the block once by 90 degrees
transform.Rotate (0, 0, 90);
`
Version of Unity: 5.6.1f1 Personal (64bit)
S.O.S
Comment
Also I forgot to add; in the first image, the cross is marking where the anchor currently is, I'd like to put that anchor in the center of my block
Your answer