05-26-2016, 11:18 AM
Hm, that's strange. If you touch the inspector, OnValidate() is called, that's the only difference in my code. Also, the inspector marks the object dirty, so Unity serialization knows about it. But as setting InitialPosition() touches a field flagged as serialized, Unity should handle that as well when called from code.
If you run your script, does Unity sets the scene dirty (* after the scene name in the titlebar)? If not, that's the cause of the issue. Btw, what Unity version you're using?
If you run your script, does Unity sets the scene dirty (* after the scene name in the titlebar)? If not, that's the cause of the issue. Btw, what Unity version you're using?