- Home /
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?
Answer by robertbu · Nov 27, 2013 at 10:51 PM
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:
Your answer
Follow this Question
Related Questions
NullReference 1 Answer
how to save prefab that indicates if the scene should be played or not? 1 Answer
Prefab position in hierarchy 0 Answers
Instantiated prefab's script gives array out of range, but when already in scene works fine 0 Answers
Create a prefab at a specific position(javascript)? 1 Answer