The smaller one is the field where the snake can move. I want to verify if the snake touches one of its borders. How can I do that?
P.S. Sorry for bad English
Yes, but when the snake hits a wall i want it to apear from the opposite wall. But i think i found out how to do it. I can make a gameobject in code, assign it the panel from the editor and then get the position of the walls using the position and width and height
Try with 4* boxcollider2D set them to trigger. Check collision with OnTriggerEnter2D and replace snake with transform.position on other side. Snake should have rigidbody2d and collider2D.