playMaker

Author Topic: Particle Collision  (Read 14227 times)

Vink

  • Playmaker Newbie
  • *
  • Posts: 19
Particle Collision
« on: December 04, 2012, 05:55:02 AM »
Hello every

Im wandering if there is a way to use playmaker to detect particle collision?
i just made a pretty cool particle system where it looks like the thing is shooting spikes, i managed to make playmaker turn the "emit" on and off with left click and it automatically detects collision when it hits other colliders and destroys the particles, i had a look at "get collision info" and tried using that to store the game object it hits, but i couldnt figure it out

im using an empty game object with these components: Ellipsoid particle emitter, particle animator, particle renderer  and world particle collider

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Particle Collision
« Reply #1 on: December 07, 2012, 01:41:20 AM »
This would take a little work to hook up in Playmaker.

The general Unity approach is described here:
http://answers.unity3d.com/questions/10717/detecting-particle-collisions.html

However, PlayMakerFSMs don't currently respond to the OnParticleCollision event. You could make a small proxy script that forwards the event to a PlayMakerFSM on the same object... I'll try to find some time to code that, or perhaps someone else will jump in :)

I'll look into getting this event into a Playmaker update... it would be cool :)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Particle Collision
« Reply #2 on: January 06, 2016, 12:22:23 PM »
Hi!
Is it any update on this? I'm trying to do the same.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Kubold

  • Full Member
  • ***
  • Posts: 112
Re: Particle Collision
« Reply #3 on: February 22, 2016, 02:13:55 PM »
Four years later and noone did this little proxy script ever?...

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Particle Collision
« Reply #4 on: February 22, 2016, 11:30:46 PM »
I threw one together really quickly just now- its attached or here https://snipt.net/mdotstrange/particlecollisionpm/

To use it add it to your particle system object- make sure the particle system has Collisions on- set the collisions to world and also check Send Collision Messages

The script will send an event called "Hit" to an Fsm on the Particle System object- it also sends the hit position as a Vector3 you can grab with "Get event info"

Add script and an fsm to the game object with Particle System


Particle system collision setup


"Hit" event sends hit position vector3
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Particle Collision
« Reply #5 on: February 23, 2016, 12:59:08 AM »
Hi, mdotstrange!

Thank you for this! Just a question.

In the Collision on the Particle System, I don't have Collision Mode and some other options there like you have in the screenshot here.

Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Particle Collision
« Reply #6 on: February 23, 2016, 01:11:09 AM »
What version of Unity are you using? I'm on 5.3 so maybe those options are from a newer version?
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Particle Collision
« Reply #7 on: February 23, 2016, 02:26:58 AM »
I have 5.2, so it's probably in the newer version. But it works anyway. :)
I tried to create a particle which will damage the player, but it didn't work. Does it only works witch particles which are already in the scene?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Particle Collision
« Reply #8 on: February 23, 2016, 08:28:18 AM »
I don't understand what you are asking- You have to apply the script to any particle system you have in the scene- and it will send hit events for the hits that system collides with- you can do whatever you want with the hit data- use it to damage enemies or whatever you'd like-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Particle Collision
« Reply #9 on: February 23, 2016, 12:56:03 PM »
Forget it! It works fine! :)
Again, thank you for this! :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Kubold

  • Full Member
  • ***
  • Posts: 112
Re: Particle Collision
« Reply #10 on: March 09, 2016, 02:40:42 PM »
Awesome :)

christougher

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Particle Collision
« Reply #11 on: August 17, 2016, 04:40:29 AM »
Such a useful Script, Thx!  Wish I'd seen it earlier.

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Particle Collision
« Reply #12 on: January 03, 2017, 03:45:01 PM »
Attached the script since snipt is no longer.
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Particle Collision
« Reply #13 on: January 10, 2017, 10:03:17 AM »
It's very useful script, but to be honest, I don't think we need it anymore, since Playmaker has "On Particle Collision" now. It works very well. :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Twood

  • Junior Playmaker
  • **
  • Posts: 76
Re: Particle Collision
« Reply #14 on: March 25, 2017, 11:05:26 PM »
It's very useful script, but to be honest, I don't think we need it anymore, since Playmaker has "On Particle Collision" now. It works very well. :)


Care to elaborate on how to use this? I can't seem to grab the normal or hit point of the particle against an object with just PM. I must be missing something.
« Last Edit: March 25, 2017, 11:38:11 PM by Twood »