Answer the question
In order to leave comments, you need to log in
How to do explosion damage in Unity 2D (so that everyone who was in the explosion radius receives this damage)?
I would be grateful even for the idea of implementation. I have a rocket flying out of a rocket launcher explodes logically. (2d)
Answer the question
In order to leave comments, you need to log in
You hang collider2D (set IsTrigger=true) and rigidbody2D (set IsKinematic = true) on all objects that should be subject to explosion. Then you create a prefab with an explosion, also set a collider with IsTrigger=true for it, and then in the script on the objects, on collisions, the OnTriggerEnter2D function will be called for you. In it, you can find out which trigger the object collided with and the intersection point.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question