Y
Y
yraiv2022-02-13 14:43:00
Unity
yraiv, 2022-02-13 14:43:00

Why do new objects interfere with others?

Faced a strange problem. There is a tower prefab, when a person clicks on it, it shows its area of ​​effect, but! when I add new towers (the same prefab in different spawn locations), I can't click on previous objects. Although the colliders do not intersect anywhere. What could be the reason? Why are objects not clickable? it happens randomly.

Turn on and off by primitive

public void OnMouseDown()
    {
        if(CyrcleUse.activeSelf == false)
        {
            CyrcleUse.SetActive(true);
        }
        else if (CyrcleUse.activeSelf == true)

        {
            CyrcleUse.SetActive(false);
        }

    }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question