I am using a action Create Object Random (100,1500),Random(100,500))
All works fin except I Create 10 of this items with a delay of 1 sec but sometimes the items overlap and I wane avoided that. Is that possebel?
Develop games in your browser. Powerful, performant & highly capable.
You should provide more details about what you're trying to achieve if you want solutions which are optimal for your project, but I think the best way to achieve this is to spawn an invisible sprite instead of your object, then, as a sub-event, spawn your object if this sprite isn't overlapping with your object. (a collision detector)
After spawning the objects, check if their overlapping and if so randomize position again, it works if you have a small number of objects and alot of space to position them. Otherwise it will get stuck in that loop trying to reposition the objects forever, because it can't find a position that doesn't overlap.
You can also push out via the custom movement behavior or manually via events, or use physics.
Thanks for help It workt fine.