Instantiate a select ring at player position

Hi,

I wanted to call a ring circulating a player when the player is clicked.
I tried

if (hightlight == true)
		{
			Instantiate (Ring, transform.position, transform.rotation);
		}

but nothing is working. The image object (i set it as plane image) is now coming out.
How do I do this? And the ring must follow the player’s position until highlight is false.

If it was me i would add the ring object to player itslef as a child at proper position and disable its render and when highlight is true, I would enable the renderer and disable it again when the highlight turns false.

This also improves the performance because instantiate and destroy are generally slow and should be avoided in most cases.
And easy to handle, you can jus have the reference of object’s renderer somewhere in the script.

17755-untitled.png

If there are multiple player objects i would have something like spawn point inside each player (in place of ring gameobject.) and I will have the ring object as separate gameObject and i would attach (by attach i mean making the ring object a child of the player ringTranform.parent = selectedPlayerObject; ringTranform.localPosition = RingSpawnPointPosition;) in to the spawnpoint of the player when he is getting selected.

17756-untitled.png