- Home /
GameObject with 0,0,0 position not being in the center
I have a rather big GameObject which is parenting many other game objects, and when I try to align the parent game object to the 0,0,0 coordinates, it does not go there, it is like its pivot point is far behind the object... Butif I give these coordinates to the Camera object, it goes exactly where it should, when its position is set to 0,0,0.
So why is this GameObject not being centered?
shouldnt the parent object be the priority when setting coordinates? after all, it is a PARENT object
Answer by GiyomuGames · Jun 29, 2015 at 06:26 AM
I am guessing that your children objects are far from the (0, 0, 0) of the parent (your "big" game object). Therefore when you put your big object on (0, 0, 0) everything seems at the wrong place. So maybe check again the coordinates of each children and make sure they are where they are supposed to be relatively to the (0, 0, 0) of the parent.
For example if the child object is at (2, 2, 0), then even if you put the parent object at (0, 0, 0) your child object will not be at the center.
Answer by NeverHopeless · Jun 29, 2015 at 06:31 AM
Have you seen "reset" option in inspector under each component you attached ?
Move your child game object to root position and align the parent first using reset, then again move the child game object to initial position in hierarchy. To summarize this, your each game object should be first reset to origin then re-position/parent-child them as per your need.
Hope it helps.
Answer by ristophonics · Feb 03, 2019 at 10:26 PM
If you created the asset yourself: Step 1: Its much more likely that your gameobject is referencing its origin from the program in which it was created, which may not be where you want it to be in Unity. To fix this go back to your modeling program and move your asset to the origin then re-Export and it should be where you want in Unity.
Step 2: If otherwise place an empty gameobject at (0,0,0) and make your larger object a child and hit Reset on its transform. If the empty parent's pivot does not match your gamebject's reset Pivot then your gameobject is not centered on the origin. Go back to step 1.
Thank you for your reply I put my project to odds on standby and when I would work on it I would do with your advice and tell you if the problem was solved! Thanking you
Answer by Giannigiardinelli · Mar 26, 2018 at 06:02 PM
Hi ! I have exactly the same problem!
I am guessing that your children objects are far from the (0, 0, 0) <
I'm checking all my "children" well at 0, 0, 0 But apparently the problem is maybe the GameObject because if you look at the image the position of "Transform" is well at the location 0 of the scene
BUT !
That of the "Mech" select "In Orange" is not at all in the center!
While everything is fine at 0, 0, 0 is this a problem when importing my 3d model into ".obj" that makes there any problem or does it se very big too can be?
The "Scale" in "Transform" is not 1, 1, 1 but I set it to "0.012" hereIs there something I don't know how to use in unity or is it something else?
Thanks in advance for helping me!In your case I am guessing that the 3D model coordinates are off in the 3D software.
Thank you for the answer. I just wrote a post about my problem! Is it weird how I have to activate my model's coordinates on unity?
How coordinates my 3D $$anonymous$$odel please ?! No one want help me...
I'm sorry I don't know. That's a question related to the 3D software you used.
Answer by zamo2022 · Dec 07, 2020 at 08:32 PM
This is what worked for me and it is extremely simple.
object.transform.position = object.transform.parent.position;
Your answer
Follow this Question
Related Questions
Getting camera to stick to object 1 Answer
How to keep the same position of the object instead of camera 0 Answers
Getting the topmost parent 1 Answer