Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Destroy Obi Particles within Radius
#1
Hey there, once Obi particles have been emitted, is there anyway to destroy all of them within a 2D radius of an object ?

Thanks for any help!
Reply
#2
(02-04-2018, 07:22 PM)AntLewis Wrote: Hey there, once Obi particles have been emitted, is there anyway to destroy all of them within a 2D radius of an object ?

Thanks for any help!

So....I've used the code found here, and by pressing a button to increase the radius of a CircleCollider2D it seems to deliver the effect I'm after. However, ideally this would work with trigger colliders which Obi does apparently support:

http://obi.virtualmethodstudio.com/forum...ead-5.html

But when I flag the collider as a trigger it stops working - is there anything else I need to change?

Thanks
Reply
#3
(03-04-2018, 09:59 PM)AntLewis Wrote: So....I've used the code found here, and by pressing a button to increase the radius of a CircleCollider2D it seems to deliver the effect I'm after. However, ideally this would work with trigger colliders which Obi does apparently support:

http://obi.virtualmethodstudio.com/forum...ead-5.html

But when I flag the collider as a trigger it stops working - is there anything else I need to change?

Thanks

Hi,

We cannot reproduce the issue. Turning any collider into a trigger still generates contacts for us. Can you post the exact code you're using? It is exactly the same as in the post you linked?
Reply
#4
(04-04-2018, 08:22 AM)josemendez Wrote: Hi,

We cannot reproduce the issue. Turning any collider into a trigger still generates contacts for us. Can you post the exact code you're using? It is exactly the same as in the post you linked?

Hi there, thanks for the response. So I resolved the issue with the trigger not generating contacts (the script auto added a solver but I was using another one that I'd created in the scene). So now particles from the emitter will be destroyed on contact with a collider marked as trigger.

However, there's still an issue remaining that you might be able to help me with. When I press a key, I am scaling the size of the boxcollider2D ( the green outline is the collider that is being scaled).  When the boxcollider2D is not a trigger, the collider destroys particles when it scales and as it comes into contact with them (as expected). However, when it's marked as a trigger they are NOT destroyed when the boxcollider2D is scaled. So to clarify - I can fire particles at the box marked as a trigger and they are destroyed, but when a trigger collider is scaled up it does not destroy the particles (but unchecking the trigger flag makes it work).

I'm unsure why there is a difference in behaviour?
Reply
#5
(04-04-2018, 08:25 PM)AntLewis Wrote: Hi there, thanks for the response. So I resolved the issue with the trigger not generating contacts (the script auto added a solver but I was using another one that I'd created in the scene). So now particles from the emitter will be destroyed on contact with a collider marked as trigger.

However, there's still an issue remaining that you might be able to help me with. When I press a key, I am scaling the size of the boxcollider2D ( the green outline is the collider that is being scaled).  When the boxcollider2D is not a trigger, the collider destroys particles when it scales and as it comes into contact with them (as expected). However, when it's marked as a trigger they are NOT destroyed when the boxcollider2D is scaled. So to clarify - I can fire particles at the box marked as a trigger and they are destroyed, but when a trigger collider is scaled up it does not destroy the particles (but unchecking the trigger flag makes it work).

I'm unsure why there is a difference in behaviour?

Hi,

I can't reproduce this either. Scaling a trigger works as intended for me.

Are you maybe changing its size instead of scaling? If this is the case, try altering its position/scale/rotation slightly too and see if this works. It might be a known bug in which changing the collider's properties without changing its transform fails to update the internal representation of the collision grid.
Reply
#6
(05-04-2018, 09:28 AM)josemendez Wrote: Hi,

I can't reproduce this either.  Scaling a trigger works as intended for me.

Are you maybe changing its size instead of scaling? If this is the case, try altering its position/scale/rotation slightly too and see if this works. It might be a known bug in which changing the collider's properties without changing its transform fails to update the internal representation of the collision grid.

That was exactly what I was doing - works a treat now, thanks for the superb support!
Reply