- Home /
Make everything use "world space" coordinates?
So I'm making a side-scrolling platformer, which is obviously going to involve a lot of game objects, as a single game object is going to be a single tile. So there's easily going to be 500+ objects per scene (level). And don't worry, I used the Sprite Packer in order to decrease the number of batches being called.
The problem I'm currently facing, is that to make it cleaner in the hierarchy, and easier to navigate, I have to make empty game objects, which I used as parents for all the moving platform parts, tiles, enemies, coins, etc. (a parent for each). And since the tiles and platform parts become children objects, they now have local coordinates.
This didn't become a problem, until just now, as I'm starting to implement moving platforms. And the way I did it, is make an empty game object, with a script that is controlling where it moves to, and its children are all the parts for that corresponding moving platform. (everyone with me so far?)
And what happens, is since the parts are children, they just move along with it, and I don't have any problems while testing the level. What I have problems with, is setting up the points, to which the platform will move.
And since the empty object is using global coords, and the platform parts are using local, it's really hard for me to align the two together. This is because I'm snapping the tiles (platform parts) together with "V", which I can't for some reason do with the empty object. This means the empty object is always slightly above or below, or to the sides of the platform parts, and I have to fix it manually. The reason I need the empty object and the platform parts to be at exactly the same position, is because the script I'm using to move it around, creates points centred on the object. So if I had it 2 units to the left, the parts would move 2 units more than they're supposed to.
So is there any way, I could just make every single game object in the project or scene, use global coordinates regardless of whether it's a child of something or not?
Your answer
![](https://koobas.hobune.stream/wayback/20220612101456im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Maya objects with different transforms. 1 Answer
Child coordinates misunderstanding. 0 Answers
rotate 90% in local space 4 Answers