Question by
DevmobiStudios · Sep 23, 2020 at 03:42 PM ·
scripting beginnerspawning problems
Aimlab Gridshot in unity
i am making an aim trainer game. 3 balls are always on screen at random places in a grid. when you shoot a ball, the ball breaks and another ball appears. i did this by spawning them in a random.range float rounded by nearest integer. the problem is, very often the ball spawns inside an existing ball which makes it weird. I am looking forward to spawn every ball at a spot where NO ball exists so that you always see 3. The current code i use is this-
https://hastebin.com/tenukapuna.cpp
Also the spawn function is called by the gun script when it hits the ball. would like some help ASAP
Comment
Your answer