Posted September 05, 2020 by jd_saints1
I am currently looking to re-design the way in which placements points are spawned into the game. These are the points in 3D space the player can place items for example, placing a chopping board on a work surface.
In this version, they are determined before the game loads - which obviously is highly inefficient. The new system I have written allows these points to be placed dynamically - i.e on game load.
The supporting screenshot shows the new function:
This function is great as each position is set according to the objects dimensions, so each point is spawned in a uniform location. However, if the dimensions of the object are decimal points (e.g 3.5 by 2.5) then points are not uniform. Additionally, as an array size cannot be a decimal point, an error is thrown. Therefore some error handling will need to implemented.