[Particles] Flamethrower

Basically, I have a particle system made so that it looks like flames. In this case, the flames are going to act as liquid nitrogen and “freeze” the enemy object when you use your left mouse click. The enemy object will have a thaw time after you stop “Flame throwing” the object. How do I go about this? Couldn’t find much information on scripting particle effects in unity 5 using C#.

My code so far (which is probably extremely far off of what it needs to be):
Flamethrower

using UnityEngine;

public class FlameThrower : MonoBehaviour {

    public ParticleSystem flameThrower;
    public AudioClip flames;
    // Use this for initialization
    void Start () {
        ParticleSystem particleSystem = GetComponent<ParticleSystem>();
    }
   
    // Update is called once per frame
    void Update () {
        if (Input.GetButtonDown("Fire1"))
           
            GameObject.Find("FX_FlameThrower").GetComponent<CapsuleCollider>();
    }
}

What I have:
Particle System ready.
Dummy Spawn point on my player (if necessary)
A Capsule Collider on my flames to capture the collision between the 2.

Any ideas or help is greatly appreciated.

BUMP – Anyone got any references or ideas at least?

What exactly do you mean by “scripting particle effects”?

We fake it on our flamethrower unit. We just play the effect and then capsule cast in front of the unit to gather up all the colliders that get “hit” by the effect. It’s cheaper and easier unless you’re trying to do something like banking particles off a wall/around a corner and need to use true particle collisions.

So basically a dummy prefab that has my particle effect and capsule collider? Then I just use update to detect my button pressed?

@Laperen - Basically I’m just trying to find the most efficient way to make a flamethrower.

That’s not what we do - but I suppose it could work.

I’m also currently trying to set up a particle system with collision for a flame thrower-like weapon and so far it kinda works (collision works and it deals damage). I’ve attached a screenshot of the settings I used for the particle system, you might have to change some of the parameters (like: force over lifetime, size over lifetime etc.) to get the desired results.

Setup:

  • The particle system is a child object of the gun and positioned at the tip of the barrel, with it’s forward direction facing away from the gun (there’s a script attached which always rotates the gun to look at mousePos - might be different for your game).
  • There’s a script attached to the same gameObject as the particle system which has an OnParticleCollision() method where it deals damage to all enemies hit.
  • Set up all layers the particle system should collide with: ParticleSystem → Collision → “Collides With”

you should also note the api where it says “The ParticleSystem receives at most one message per Collider that is struck. As above, ParticlePhysicsExtensions.GetCollisionEvents must be used to retrieve all the collision incidents on the GameObject.”
from: Unity - Scripting API: MonoBehaviour.OnParticleCollision(GameObject)

but “GetCollisionEvents()” is stated as “obsolete” so right now the flame thrower can only deal damage once per frame (per hit target), even when multiple particles hit the same target; it can hit multiple enemies at the same time though.

See if this can help you.
Link:-
https://www.youtube.com/watch?v=x_wcmR00i1E

doesnt work, “Do not create your own modules” message
even though im not creating