I have object A and Object B
object A should disable with a buttonpress collision of objectB.
And It works well.
I have as variable:
[SerializeField] Collider2D c;
if (Some button is pressed) c.enabled = false;
I just want to know how to access the collider without using SerializeField.
I tried with
c = objectB.GetComponent<Collider2D>();
But it didn’t worked.