C#C
C#2y ago
TearsRfuel

why is this while loop infinite?

this is crashing unity:
(complete beginner btw literally just started messing around with code 2 days ago)

If i click on an object with a cube or sphere tag, generate some random values, destroy the object I clicked on, genereate a new random spawn position using the random values. WHILE the new spawn position is colliding with an existing object, generate a randomSpawnPosNew, and set randonspawnPos equal to that, once the random spawn position is not colliding with any other objects, instantiate the object that we clicked on.
tst.PNG
Was this page helpful?