- Home /
Question by
Theohune · May 25, 2020 at 12:13 PM ·
particlescollision detectionparticlesystemparticle systemparticle collision
Unity 2D Particle System's collider doesn't trigger other colliders for scripts.
I have a "button" that can be enabled by the player and other objects but for some reason it does not get triggered by the particle system that the player emits (kinda like a beam). The Particle System does collide with the box collider2d on the button but it does not work in the script. (I get the Debug.Log if the player touches the button but not if particles bounce of it.) my script on the button:
public class PinkHole : MonoBehaviour
{
private bool isTriggered;
void OnCollisionEnter2D(Collision2D other)
{
isTriggered = true;
}
void OnCollisionExit2D(Collision2D other)
{
isTriggered = false;
}
void Update()
{
if(isTriggered == true)
{
Debug.Log("Triggered");
}
}
}
Comment