- Home /
Why prefab revert does not work for position and rotation?
I made position change to the prefab for one of my gameObject that I have in each of my scene. My goal is that in each different scene that object uses the default position of the prefab.
The problem is that the position change made in prefab does not apply to my gameObjects. Also, when I open a scene, select my gameObject and press the revert button in the inspector window, everything does seem to revert except the position and the rotation...
So what's up with that? Why is it not working?
A prefab is meant to be like template. The position is not part of the template, it's part of the instance. For that reason, changing position of a prefab does not affect the position of the instances. Think of the pretty common scenario where you have 3 instances of the same prefab in the same scene (3 enemies for example). You wouldn't want them all to be in the same place...
Answer by Owen-Reynolds · Nov 01, 2013 at 06:09 PM
For probably 99% of uses, Reverting a prefab should keep the current position/rotation.
They've maybe dragged in a bunch of chair prefabs, faced them in a circle, and are tweaking each one's look. They decide they hate the changes on one, and click Revert. They probably expect the scale to snap back, and clearly all the child local positions (legs?,) but they don't want the entire chair to snap to the corner of the map, facing North.
If you need all copies of prefab X to auto-share a common pos/rot, you could put a tiny script on the prefab that snaps position/rotation in Start/Awake.
Your answer
Follow this Question
Related Questions
transform.forward doesn't work in my code 3 Answers
how to ignore transform.position.y 3 Answers
How to center prefabs' children to (0, 0, 0) without changing their position relative to each other 1 Answer
Accurate placed object's transform messes up on game start 1 Answer
Game Object won't match rotation of new positions transform 1 Answer