[solved]confused about access to instances

i am running this in update to Instantiate multiple prefabs.

the look at and the distance bit works as expected while the mouse is pressed.

the bit about color continues on the first instance only.

there must be something different when accessing materials but i dont know what.

if (Input.GetMouseButton(0))
	{	
		if (hitObject.name == ("floor"))
		{
			
			//this all works
			var dist = Vector3.Distance(point, newObj.position) * 0.1;
			newObj.localScale = Vector3(dist + .2, dist + .2, dist + .2);
			newObj.LookAt(point,normal);
			//this part doesnt work.
			newObj.gameObject.Find("vine").renderer.material.color = Color.red;
		}
	}

Are you sure there’s a game object named ‘vine’? And if so, are you sure there’s only one?

thank you for responding. your comment actually caused a lightbulb!

trouble was there were many objects called “vine”.

so i added this on mouse up:

newObj.gameObject.Find("vine").name = "vine1";