Quantcast
Channel: Answers for "My player object is getting clone which doesn't show up in inspector"
Viewing all articles
Browse latest Browse all 9

Answer by IgorAherne

$
0
0
before the code put @ExecuteInEditMode if in java. [ExecuteInEditMode] for c#. If it's c#, make sure you write using UnityEditor right after the GameObject.Find instruction of yours, on a new line, put: Selection.activeObject = avatar; If you are writing in c#, here is the code: using UnityEngine; using System.Collections; using UnityEditor; [ExecuteInEditMode] public class w : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { GameObject avatar = GameObject.FindGameObjectWithTag( "Player" ); Selection.activeObject = avatar; Debug.Log (avatar); } } **This is an example of the code, you have to stick it in your code, after the avatar was defined.** As soon as you start moving your object with this script in editor window, it will switch to the object with "Player" tag. Now, when you see it you can voodoo, slap and be strict with him :D

Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>