Topic: click and change, color,size,turn off part of the 3d marker
Hello thanks for everything for the previous help, but now I would like to understand how to change the markers 3D during execution, let me explain: I created a marker that contains streets and buildings and is positioned on the map, I have to interact with these elements such as change color to the roads to highlight them when you click on them, or light up other paths present in the same marker or another example simply light up a certain marker in red when clicked
with my code I can change the color of my prefab present in the scene but the clone object under 3d marker does not change and therefore not even on the map! how can i modify it via code, do i need to recover the clone components? can you give me an example, please
I wish I could change colors, materials, transformations,turn off and on parts of the 3d Marker
Thank you very mutch
for example, here I put the code I use to change the color of the 3d Marker when it is clicked
[SerializeField] Material[] material;
[SerializeField] Renderer rend1;
void Start()
{
rend1 = GameObject.Find("Pin1").GetComponent<Renderer>();
rend1.enabled = true;
rend1.sharedMaterial = material[0];
void Update()
{
if(Input.touchCount>0 && Input.touches[0].phase==TouchPhase.Began)
{
Ray ray2 = Camera.main.ScreenPointToRay(Input.touches[0].position);
RaycastHit hit2;
if(Physics.Raycast(ray2,out hit2))
{
if (hit2.collider.gameObject.tag == "contenuto1")
{
rend1.sharedMaterial = material[1];
Debug.Log("contenut1");
}