- Home /
Why are my GameObjects altering themselves?
I have two problems which might be related to each other:
1) Upon pressing play, several GameObjects in my hierarchy re-parent themselves to different locations, permanently, without me doing anything at all. When I try to change their own internal hierarchy (it was an object with subobjects), a specific subobject removes itself to elsewhere. This subobject is exactly the same as the other ones, but it's always this one. There are a few similar occurences.
2) Various UI elements change their position and size, both in general and relative to each other, often upon pressing Ctrl+S or Ctrl+Z. The elements include RawImages, Texts and Buttons, and are on the same canvas. They are moving to locations never previously been to, and to sizes I've never done, but often the same ones repeatedly.
Has anyone encountered either of these problems? Am I going insane? I will try reinstallation, but I have a feeling the problems will just resurface eventually.
Parenting Issue: This is the current location of the GObject IGM_RM_PartyButtons: http://i.imgur.com/tzByW4f.png
I move it to be a child of IGM_RM: http://i.imgur.com/luWQVre.png
After running the program, regardless of whether I saved or not, and without touching the object at all in the code, this is the result: http://i.imgur.com/8lO5S16.png
There are similar issues if I try to reparent this differently, and weirder issues if I try to make it a parent. This object right now is the only one with this bizarre behavior.
Ctrl Key(?) Issue This is how IGM_RM_PartyButtons looks when it is active. Besides changing selections in the menu, I did no other actions after loading the scene: http://i.imgur.com/QaqL9yG.png
If I press Ctrl+Z enough times, this happens. The objects are all resized and moved to the center, but it happens with other types of UI objects as well, and they are not always moved to the center, though they are moved to the same place(s) consistently: http://i.imgur.com/drmsGTA.png
Ctrl+S can also trigger this behavior, which is even more of a pain. However, selecting the save or undo functions via drop menu does NOT result in this kind of behavior. It doesn't seem that all Ctrl hotkeys cause this behavior, however.
Thanks for all of your help!
IT relies on how you handle the layouts and anchors of your UI elements, thsoe can adapt their size/scale and position depending on the canvas scaling parameters.
Post some screenshots of your UI (how it should be, how it turns out..), we have no idea of your configuration at the moment.
EDIT : I suppose you followed some tutorials, cause the new UI is not as obvious as we could think.
Please take a look at my updated post; I have added images and descriptions.