I am creating spells for my game.

The collision with a normal fireball works just fine, what I am trying to achieve is to have the player_2 getting hit when the green explosion happens.

How can I achieve that? I tried adding explosion force with very high values just for testing purposes, but I could not make it work.

Below you can check a demonstration of what I am trying to do, and a piece of the code I tried. enter image description here

  • \$\begingroup\$ Have you tried using Physics.OverlapSphere to find colliders in range of the explosion? \$\endgroup\$
    – DMGregory
    Commented Oct 17, 2019 at 0:10
  • \$\begingroup\$ @DMGregory I will try. But I was trying to avoid doing manual physics, and instead I wanted to just rely on the RigidBodies. But I guess it is just easier if I go for manual stuff, since I am still a newbie with Unity. \$\endgroup\$ Commented Oct 17, 2019 at 10:54
  • \$\begingroup\$ This in no way prevents you from letting rigidbodies continue to handle your physics. \$\endgroup\$
    – DMGregory
    Commented Oct 17, 2019 at 11:12
  • \$\begingroup\$ From what I understand, I can use the collisor as triggers and in the OnTriggerEnter apply the force manually by detecting with the PhysicsOverlaps, right? \$\endgroup\$ Commented Oct 17, 2019 at 12:00
  • \$\begingroup\$ Did you try it? Did it work? If so, you can post it as an Answer. \$\endgroup\$
    – DMGregory
    Commented Oct 17, 2019 at 12:01

1 Answer 1


You can view the particle system settings in the inspector and check on the collision box and specify what it should collide with.

enter image description here

The first spell that hits normally is because the two collide. The second spell needs to have collision added to the particles since the transform is not actually near the enemy to perform a typical collision.

  • \$\begingroup\$ This looks like a great option! I will definitely try this later on. \$\endgroup\$ Commented Oct 17, 2019 at 12:06
  • \$\begingroup\$ Either way works. I've used both this and @DMGregory s suggestion many times depending on the project. Physics.OverlapSphere(position,radius,layer) works great also just give it a position, match the radius to the radius of the spell and a layermask to hit. then just loop through the returned collider array and do as you want. \$\endgroup\$ Commented Oct 17, 2019 at 15:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .