0
using UnityEngine;
using System.Collections;

public class ParticleSystemCollisionManager : MonoBehaviour {

    void OnParticleCollision(GameObject other) {
        // work on pc build, webplayer build
        //when switch to webgl build, it work in editor
        //but after building, run webgl build in browser, it does not work 

        Debug.Log("Collision on " + other.name);
        Destroy(this.gameObject);
    }
}

I build a game TMS

It worked on pc/web playter. And it worked in editor (webgl build setting) too. But after I build it to webgl, it does not work. It seemed that OnParticleCollision does not run.

Do you know the reason? Could you help me fix it?

gman
  • 100,619
  • 31
  • 269
  • 393
tim
  • 1,454
  • 1
  • 25
  • 45

1 Answers1

0

I got it.

  • Increase the Collision Quality in Collision, and do not forget set the mode to world and 3d.

enter image description here

and the reason is here:

Collision Quality:
This affects how “watertight” the collisions are - at lower quality levels, particles may sometimes pass through colliders (World mode only).

tim
  • 1,454
  • 1
  • 25
  • 45