- Home /
Detect collider collision ,identify and access colliding colliders
Hey, I'm making an explosion in a game and for the heat wave, I made a sphere with a collider that grows progressively. Now I want to access all the colliders that are colliding with the collider of the sphere of the heat wave. How do it do that ?
The script of the dimension :
float expansionRate = 10 * Times.deltaTime;
float diameter = 350 * expansionRate;
//It is supposed to grow 350 meters every 1/10 of a second, so 3500 meters every second.
Vetor3 dimension = new Vector3(diameter, diameter, diameter)
heatWaveSphere.transform.localScale = dimension;
Collider[] AffectedColliders = Physics.OverlapSphere(transform.position, diameter);
PS : I tried using an OverlapSphere, and it works to get the colliders, but for some reason that I ignore, it grows much faster that the sphere, while having the same parameters
Your answer
Follow this Question
Related Questions
Physic based golf game - ball bouncing off the connection of colliders on flat surface 2 Answers
Best collision detection method? 2 Answers
Avoid Player bouncing when colliding with objects 3D 1 Answer
overlapsphere to destroy NPCs on exit 1 Answer
Detect if a non-trigger collider is inside another collider 1 Answer