2019-04-14, 09:12 PM
Hi, I am developing a building system based on?a map grid. I?figured to use this grid (only xy axis based) I would only need to use a simple algorithm where I devide the current player position by the grid size.
Lets say I want to get the nearest grid in range of?a player, I need to round the player's position till it's devisible by the grid size to get the X Y position from that grid.
Could anyone explain me how to create a function that rounds?the player position to the nearest value where it is devisible by a specified value?
Lets say I want to get the nearest grid in range of?a player, I need to round the player's position till it's devisible by the grid size to get the X Y position from that grid.
Could anyone explain me how to create a function that rounds?the player position to the nearest value where it is devisible by a specified value?