• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Rounding float to make it divisible by specified value.
#1
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?
  Reply


Messages In This Thread
Rounding float to make it divisible by specified value. - by Xray - 2019-04-14, 09:12 PM

Forum Jump: