I am making a snake game. I'm basing it on a basic tutorial game, which does no collision detection, wall checking or different levels.
All snake head, piece, food, even the background is made of Texture2D
. I want the head of the snake to detects 2D collisions with them, but Rect.contains
isn't working. I'd prefer to detect collisions by onTriggerEnter()
for which I need to add BoxCollider
to my snakeHead
.
BoxCollider2D
? You have an entity, you have a texture attached to it, and you know the other thing you need to add. Why not add it? \$\endgroup\$