Search Unity

setting multiple prefabs references at once

Discussion in 'Editor & General Support' started by FeastSC2, Mar 11, 2018.

  1. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    I have lots of enemies using the same HP script and now I'm adding to that script a new GameObject reference which is a world canvas showing how much damage this enemy received upon being hit.

    How can I go about setting that gameobject reference to all of the existing prefabs that are using this script?
    ( I don't want to go over every single enemy prefab and add that damage gameobject in the new reference slot of the HP script ).
     
  2. lorux

    lorux

    Joined:
    Feb 9, 2017
    Posts:
    31
    1. Select all the objects that has the script attached at once.
    2. Hit the lock icon (its small at the top right of the inspector window) to lockl lock your selection
    3. Navigate where your GameObject reference is and drag it to the script.
    4. All objects from your selection should be updated.