- Home /
Set the Inspector target in Playmode.
Is there anyway to set what the inspector is looking at when Playing? When the game starts I create the player from a Prefab and I want it to become the selected object so I can view its fields in the inspector.
Thanks in advance.
Comment
Best Answer
Answer by yeagz7 · Sep 03, 2013 at 06:15 AM
Was close. Here is the solution for anyone else interested. Very helpful in saving those few seconds if you have to drill down everytime.
UnityEditor.Selection.objects = new UnityEngine.Object[1] { gameObject };