- Home /
how to get the prefab path of a game object in Game mode,not Editor mode
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?
Answer by rutter · Nov 02, 2015 at 10:27 PM
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.
thanks for the reply, seemks like I have to attach a script to the game object
Your answer
Follow this Question
Related Questions
Destroy all Objects of a Type in Game 1 Answer
How to make changes to a copied object 1 Answer
How can i set a prefab to x=0 and y=0. 3 Answers
Assign an instantiated GameObject? 1 Answer
How do i tell what gameobject im on 1 Answer