Search Unity

Make all instances of a prefab take an instance of another prefab.

Discussion in 'Prefabs' started by unity_GT0mI3ShOyMpfg, Apr 29, 2022.

  1. unity_GT0mI3ShOyMpfg

    unity_GT0mI3ShOyMpfg

    Joined:
    Apr 6, 2022
    Posts:
    2
    So I have this script on a powerup object that modifies the values of a script Player.

    I have changed the prefab of the powerup object to take the Player prefab as a serialized field. However when I create an instance of the powerup object it says it has the Player as a field but it isn't the actual instance of player that is currently in use, I can fix that by manually dragging the Player from the hierarchy to the instance of gameobject. How can I make it so that it automatically takes the specific instance of Player as a field?