Update child gameobject positions when rotating parent gameobject
Hello,
I'm a beginner and I'm currently trying to create a 3D Tetris. Since 1-2 Weeks im trying to rotate my Tetromino properly, but it's not working the way I want.
So this is my "T" Tetromino. It's made of 4 Cubes, which are combined with an empty gameobject like this:
When I rotate the "T" gameobject with transform.Rotate(0, 0, -90)
, optically every cube moves, but not really. There is a blue dot on the first Picture. When i rotate my gameobject, it rotates around this point. After the rotation, every cube gets its new transform.position
expect the middle one. Optically it moves one unit, but its transform.position
doesn't change.
The same with the other figures. There is always one Cube, which transform.position
doesn't update. I kinda know why its position doesn't change, but i still don't know what to do.
I tried many stuff, but i failed. Summarized I want my gameobject to rotate and update its position. Is there a way to do this?
Best regards
Your answer
Follow this Question
Related Questions
My camera is moving away from the object it's rotating around, how do I fix this? 0 Answers
Convert Local Position To Global on a Child Object 0 Answers
Perfectly Syncing the rotation of two objects 0 Answers
Rotate an object in order to make one of his face to face the camera 1 Answer
Animations unwanted movement and rotation after updating 0 Answers