Hi all, I’m a newbie to unity (javascript background) - I’ve been looking for something that is suitable for my needs but having difficulty finding an answer. I have about 70 balls bouncing around the screen and I need to be able to efficiently and quickly check when they collide into an x and y co-ordinate of the current input position - so a user could have their finger on the screen and swiping and the collisions are detected.
The balls have Circle Collider 2D and RigidBody 2D components.
The balls do not interact with each other, so they overlap - so if a user clicks the intersection of n balls, they all would need to detect the click/touch - of which I can then code some resulting logic, including knowing how many balls were involved in that input collision.
I tried some tests with mouseover by adding this to the prefab ball script:
function OnMouseOver()
{
Destroy (gameObject, 1.0);
}
But that took a second or so after the mouseover to respond…I must be doing something quite wrong! How can I get a quick snappy responsive setup to achieve this? huge thanks.