whats the best way to make a grid based game. I want 100 by 100 grid, and player can trigger each cell on and off when they are in it.
it’s 10000 triggers, is that too many?
I’ve read OntriggerStay is expensive, if so , what is the alternative?
Thanks for your help.
10,000 trigger colliders is probably too much, yes. You would be better off with a simple script that takes a few parameters:
- player position
- grid origin position
- grid square dimensions
and determine which grid square the player is inside based on that. The math is pretty straightforward.
2 Likes
Thanks for the reply.
Ok. I guess I just check player position, see which tile it is on, and then.turn that tile off.
get position of player…set tile on/off
If my player is float, how can i get the closest centre of the tile, to feed back to SetTile. Anyone know what function can do that? Some kind of rounding function i guess.
Thanks