Question by
MBehtemam · Jun 11, 2016 at 09:11 AM ·
collider2d
OnTriggerEnter2D calculate wrong collision when Object is scalling
I have 4 object and a boss and each object has Rigidbody2D and box collider 2d with "is trigger" is enable. also all of these object is scaled down about half (scale.x = 0.5f and scale.y is 0.5f). the code is :
private void OnTriggerEnter2D(Collider2D col)
{
if (col.tag == "Obstacle2")
{
body2d.mass += 0.10f;
}
}
the scenario of problem is when boss trigger with first object and move to other object even if boss dosen't collide with other object OnTriggerEnter2D is called !!! . and when boss move near with huge distance also OnTriggerEnter2D is called. but if boss dosen't collide with of object it dosen't trigger but immideatlly after first trigger it's calculate OnTriggerEnter2D for all of object in the scene. i also update my unity to "5.3.5p3 patch" but it dosen't work.
Comment