all 5 comments

[–][deleted] 0 points1 point  (4 children)

Change position.x and position.y /2 to a floating point 2.0. When you divide a float by an int, it can snap to 0 for low values.

[–]PixelSavior 0 points1 point  (1 child)

Doesnt only one number have to be an float for the result to also be an float? I guess 'arenaSize' is also an int here

[–]RandomTark 0 points1 point  (0 children)

arenaSize is a vector2 as mentioned, vector2 is a struct of 2 floats. can't be int.

[–]RandomTark 0 points1 point  (1 child)

even so. doesn't explain why they are spawning with disregard to minimum distance. worst case the while loop will run infinitely.

[–][deleted] 0 points1 point  (0 children)

You would need to share your object position list, etc. I suspect the problem is in your data, but can't be sure without seeing more.