2d icon at center of 3d object

How can I create an icon at the center of an object targeted and stay put no matter where the players is. The script I’ve made is on the object itself.

This is what I’ve got so far. Any assistance is welcome! Thanks.

private Transform myTransform;
public Texture2d icon1;

void Start () 
	{		
	   myTransform = transform;	
	}
void OnGUI() 
	{	
                
	    Vector2 myPos = myTransform.position;
		GUIStyle myStyle = new GUIStyle(GUI.skin.label);
		GUI.Label(new Rect(myPos[0], myPos[1], 50, 50), icon1);
	}

2 Answers

2

Your question is not easy to answer, unfortunately, You may find an answer in this site Click Here

Stop spamming link that is not even working.

–

thank you for the reply. page says "This ID doesn't exist!"

–

Your question is not easy to answer, unfortunately, You may find an answer in this site Click Here