GameObjectReplacer is a Unity Editor tool that allows you to seamlessly replace selected objects in the hierarchy with a prefab of your choice. It provides options to match the scale, rotation, and position of the original objects to ensure a smooth transition in your scene.
- Replace Multiple GameObjects: Select and replace multiple GameObjects in the hierarchy in one go.
- Match Transformations: Choose to match the position, rotation, and scale of the original objects.
- Non-destructive: Uses Unity's
Undosystem to ensure the operations are reversible. - Edit Mode Only: Ensures that replacements can only be done in Edit mode to prevent accidental changes during Play mode.
- Copy the
GameObjectReplacer.csscript into your Unity project'sEditorfolder. - Once Unity compiles the script, you'll see a new menu option under
WindowtitledGameObject Replacer.
- Open the tool from
Window > GameObject Replacer. - Select the objects in the hierarchy that you want to replace.
- Drag and drop the desired prefab into the "Prefab" field in the
GameObject Replacerwindow. - Choose the transformations (position, rotation, scale) you want to match.
- Click "Replace" to replace the selected objects with the chosen prefab.
Feel free to fork the repository and submit pull requests for any enhancements or bug fixes. All contributions are welcome!
This project is licensed under the MIT License. See LICENSE for more information.