- Home /
Issue with addExplosionForce
(Sorry for my english)
Scene: Several boxes, each box have child gameobject (big scale sphere collider (isTrigger=true) attached on child (for simulate zone of visibility)). So if point of explosion is inside a sphere collider - boxes go only upward, if the point of explosion is outside sphere collider - all fine.
It seems addExplosionForce don`t ignore collider (istrigger=true) if explosion point is inside the sphere collider component of gameobject`s, and add only Y+ component of force. (I use that code: Example in Unity Script Reference)
Has anyone encountered this problem?
I solve this problem by using: hit.rigidbody.AddForce((hit.transform.position - transform.position).normalized * expPower*100/distance); instead: hit.rigidbody.AddExplosionForce(expPower, transform.position, expRadius);
Your answer
Follow this Question
Related Questions
Mecanima script access? 1 Answer
Selectively detecting collisions with IsTrigger() and multiple CollisionBoxes 0 Answers
GameObject with 1 top Collider IsTrigger and 1 bottom regular Collider problem. 1 Answer
determine nearest y outside of mesh from point.y inside 1 Answer
How to avoid a gameobject inside another while they're in collision? 0 Answers