- Home /
What is the best way of getting the system path of a GameObject?
Hi, I'm looking for an efficient way to getting the system path of each GameObject in an array of GameObjects and returning them as a string.
I've been looking into AssetDatabase.GetAssetPath, but it doesn't seem to return a valid string.
Debug.Log(AssetDatabase.GetAssetPath(_Cube[i]));
Is there another, more efficient way to get the system path. And how might I get the above AssetDatabase to return a valid string?
Answer by whydoidoit · Mar 19, 2013 at 01:41 PM
AssetDatabase.GetAssetPath will return a valid path if the thing you pass is actually a project prefab. You cannot get the path of a scene object (it doesn't have one).
Your answer

Follow this Question
Related Questions
how to set an object on a path,how to set an object on a track 0 Answers
Instantiate prefab at specific path 1 Answer
How to check connection? 1 Answer
Find prefab path of a gameObject? 6 Answers
Accessing local system ( File Browser ) 2 Answers