Block based puzzler collision?

I’d like to start a puzzle game based on blocks that shift around a level.

Would using the OnCollision2D methods be better than using a custom rec collide method to deal with collision?

I haven’t done any 2d in unity for donkeys years, in fact I have been on a break from all coding. I want to get back into things and start with something small.

Depending on the details of how you want the game to work, you may not want to use physics-based collisions at all. As a rule of thumb, physics is good for making thing look pretty, but it’s a pain if you’re trying to get precise or replicable results–which many puzzle games want.

If your puzzle rules are discrete (e.g. if you use a grid) then I’d typically recommend you turn off the physics and write your own code for deciding when things are colliding.

1 Like

Definitely agree with @Antistone here… unless there really is a physics element to the puzzle game (ie. a puzzle piece can be jostled slightly off-center and that’s a relevant part of the game, i.e., NOT Tetris), do not use physics at all.

Instead, just keep track of your board / world with a 2-dimensional array of cells, and do all the logic via that, then create and move GameObjects to represent what is going on.

1 Like