Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

OnParticleCollision - any particle tag?

Discussion in 'Scripting' started by WVlad, Sep 27, 2014.

  1. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    A space ship have a laser turret. It does not correspond to a specific player weapon. It means that when the player changes a weapon the turret particle system will stay the same and will be reused for a new weapon too but it should make another damage numbers. There is no one-to-one correspondence between weapons and actual turrets.The player can shoot with only one weapon at a time.

    So I have a particleSystem that is reused by different weapons. When the player shoots the current weapon calls "Emit(1)" on a single particle system. But when I detect a particle collision I can't say with which weapon it was emitted so I don't know what damage I need to apply.

    How can I identify one emitted particle in shuriken?