Answer the question
In order to leave comments, you need to log in
Animating the random position of an element?
Hello. The second day I'm scratching my head.
How can I ensure that the elements do not touch each other?
Here is an example
Answer the question
In order to leave comments, you need to log in
If you do have circles, then the touch condition is:
Distance(C1, C2) = R1 + R2, where C1 and C2 are the centers of the circles, R1 and R2 are the radii.
In the simplest case - check each with each at each tick. If there are too many circles, use some existing algorithms.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question