Imported Prefab Uses A Different Coordinate System

I’m using a prefab that requires exact positioning over another object. However, when I imported the prefab, it does not follow the same coordinate system as the object underneath. For example, when I line the objects up, the base object has an x-position of -10, but the prefab has an x-position of 0.

I plan to dynamically place images and textures on the prefab over predefined areas of the base object (i.e. to position pieces for a board game). Is there any way to convert the coordinate system of the prefab so that it matches the system for the rest of my scene?

1 Answer

1

If these two objects share a parent/child relationship, then you are getting an ‘x’ position of 0 for the child because the position displayed in the inspector is relative to the parent. If there is no parent/child relationship, then you are likely having issues with the position of the pivot point. Changing the pivot is best done in a 3D modeling program, but this editor script can be used as long as the pivot is within the bounds of the mesh of the object:

http://wiki.unity3d.com/index.php?title=SetPivot

Thank you. The pivot point was the issue.