Game Object Replace Tool

AutoGridSnap Script

GameObjectReplaceTool Script

Portalarium’s “Dungeon Master” Bill Kirkman provided this C# Unity script on the Developer+ forums for Shroud of the Avatar, and has given permission for it to be freely distributed. It allows users to select any object and replace it with another object, without breaking connections. Using a Dungeon Kit, for example, one could decide to swap all square room corners with rounded ones by selecting the prefabs and choosing to replace all.

To use the script, simply download and extract the file below. In Unity, click Assets -> Import New Asset, select GameObjectReplaceTool.cs and click Import. Alternatively, you can simply place the script file in the Assets->Editor folder of your current project.

Per “Dungeon Master” Bill:

This tool will allow you to replace any target game object in the scene with a specific source object. Source objects can be any game object (both prefab or not) and can come from within the scene hierarchy or the project asset library (but must be a prefab if swapped in from the asset library). Prefab connections will be maintained when swapped in and there are several options to allow some flexibility.

When using the tool, simply drag & drop objects into the Target/Source slots (you can also click the circle menu to pick objects) or check the selection box to only target objects you currently have selected then click the Replace Objects button at the bottom to replace all instances of the target object (based on name). I also implemented tooltips this time around if you hover over some of the options (some options are very special case). Undo functionality will only work with the newest version of Unity, make sure you save your scene before using the tool just in case.

The Mad Hermit has created a video tutorial on using the tool as well.

Get It

You can download the file below, and freely distribute it.

Thanks to Portalarium for developing the script, and for allowing us to share it!

Browncoat Jayson

Join me in New Britannia!

You may also like...

1 Response

  1. November 22, 2013

    […] Shroud of the Avatar backer Joviex provided this C# Unity script, which is in turn based on Portalarium’s Game Object Replace Tool. […]

Leave a Reply

Your email address will not be published. Required fields are marked *