C
C#11mo 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.
No description
6 Replies
Saber
Saber11mo ago
your not generating a new random position, your just reusing the exact same position
TearsRfuel
TearsRfuelOP11mo ago
oh right cus the random values are the same whats a good way to generate a new position?
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
TearsRfuel
TearsRfuelOP11mo ago
i actualy treid that and it failed
Unknown User
Unknown User11mo ago
Message Not Public
Sign In & Join Server To View
TearsRfuel
TearsRfuelOP11mo ago
tis true i follow you ive been changing things
Want results from more Discord servers?
Add your server