hi,
as the title says,I have a game object ,and it’s cloned from a prefab, is there any way to get the prefab path from the game object?
I know there is a API “PrefabUtility.GetPrefabParent”,but seems like it only works in editor mode, in game mode I get the return value “Null”.
any idea how to get the prefab path from game object in game mode?
You can’t. Once an object is spawned in game mode, it’s just an object like any other.
If you really need access to that, you might be able to attach that information in editor mode by creating a custom component with a string variable. You can embed any sort of information you like, as long as it’s something you can use later.