- Home /
transform getting altered by changing prefab settings
Hello Unity Community!
I keep having a weird thing going on: It seems like every time I make a change to my variant prefab (level floor), it keeps giving the transform a completely new concept of position and scale. Usually when this happens, it's when I (usually accidently) apply changes on the variant to the base prefab.
Here's some of the things I'm referring to: Although the transforms are in precisely the same x location, and nearly the same y, the transform is given vastly different and very random coordinates. If I reset the floor's position back to 0, it will end up about four or five squares above the player's head (and yes, the player is just a blue line. I'm not concerned about art yet). Does anybody know how I can fix this without having to delete my prefab over and over again?
Answer by wb6089967 · Apr 23, 2021 at 07:20 PM
Hello! Okay, I figured out what I was doing here too. I put the "Player" under the main scene hierarchy, while the "Level 1" (since renamed to "Level Floor" in the picture below) game object was a child of an empty game object I titled "Levels". The "Levels" game object was set to the same weird number that I was getting on the level floor game object, and so that number became the new 0, 0, 0 for every child of that object. But if you just want the simple answer: click on your parent object (in my case "Levels"), find the inspector window, and click on the three dots at the top-left of the transform component, and in the drop-down menu, select "reset" and that will fix this issue.
And I should probably point out as well, it had nothing to do with prefabs.
Your answer
Follow this Question
Related Questions
Dragging prefab into hierarchy reset position now? 0 Answers
Object with many children will not show up in the center although its coordinates are set to 0, 0, 0 1 Answer
Prefab teleporting on play mode ? 0 Answers
Checking Position 1 Answer
Why can't I instantiate an object that is +5 in the x and z axis? 1 Answer