Search Unity

Resolved Get original prefab in Project while in Playmode in Editor

Discussion in 'Prefabs' started by FelipeReis, Oct 12, 2020.

  1. FelipeReis

    FelipeReis

    Joined:
    Jan 27, 2012
    Posts:
    38
    Hi, I making an editor tool and I need to know the original prefab of a gameobject in playmode,
    I'm trying to use PrefabUtility.GetCorrespondingObjectFromSource(gameObject) but it returns null,
    Is this possible?
     
    Last edited: Oct 13, 2020
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    No, the concept of Prefabs doesn't exist as such at runtime. Runtime instantiation of Prefabs just clones the object, it doesn't keep track of overrides or what the originating Asset is, or any of the edit time Prefab functionality.
     
    FelipeReis likes this.