so I was doing a course on unity 2d, the game I’m making currently is kind of a 2D platformer, a boarder sliding on ice !!
the thing is I wanted to add particle effect when he slides on ice, if board is not touching the surface particle effect would stop, so to do that I added a circle collider at the end of the board and set “is trigger” to true. The board already had capsule collider, to detect collision with the ground.
made a script if collision detected play particle effect.
public class ParticleEffectIfTouchingGround : MonoBehaviour
{
[SerializeField] ParticleSystem ParticleEffect;
private void OnTriggerStay2D(Collider2D collision)
{
if (collision.tag == "BoarderBottom")
{
ParticleEffect.Play();
}
}
}
but it won’t work until I pulled the circle collider all the way down to the bottom of the board. Why ??
