Why is my OnTriggerEnter2D(Collision2D other) function not working ?...

I’ve used Collider 2d in both the gameobject, Is trigger is also marked and used Rigidbody 2D in one of the gameobject and body type is also Dynamic, gravity is set to zero,
But it’s still not working I’ve checked everything is correct but it’s still not working
No “Warning” No “error” but it’s still not working,
Please, fellow programmers help me out,
The Script I’ve written is mentioned below:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Powerup : MonoBehaviour {

private float _speed = 4.0f;

// Update is called once per frame
void Update () 
	transform.Translate(Vector3.down * _speed * Time.deltaTime);	

void OnTriggerEnter2d(Collider2D other)
	Debug.Log("Collided with: " + other.name);
	if(other.tag == "Player" )
		Player player = other.GetComponent<Player>();

		if(player != null)
			player.canTripleFire = true;

	} */		


Change your method name to “OnTriggerEnter2D” and it will start working… Hopefully… :smiley: ,This method is case sensitive and you have written “OnTriggerEnter2d” while the original one is with capitol “D” i.e “OnTriggerEnter2D”

your script have working for my.

Check the collision matrix in: upper-left corner of the screen -> Edit -> Project settings -> Physics2D. Then in the inspector look at the matrix and check if layers of your objects are set to collide with each other.