I have a prefab i instantiate, and when i change its position and local position to 0,0 it doesn't seem to change in hierarchy view in editor. I have a debug system that prints out values to a gui text object and it says the local position before and after is 0,0. But in the editor it is a random huge value. Why would this be?
I'm using this code to change its positions:
This code works fine with no compile errors and print sout the location to the gui text object. Here is a screenshot of this in the editor window(I highlighted notable parts): There are no null reference exceptions and the script is on the gameobject i wnat to modify. Notice that the gameObjects's transform only has localPosition and not normal position. Why is this? It is not a child of another object....Just a prefab.
asked May 22 '12 at 10:30 PM
In you full script you have this code:
But labelOfBuilder is a component on the same game object as the Builder script, so it moves the builder to that location, hence your changed coordinates.