Can't get Collision to detect triggers in unity 2d

I’ve been trying for a while to get the players collision to be detected against the objects but alas nothing has worked, and scrubbing through forum responses hasn’t helped either. Either I have made a meager mistake or am doing something entirely wrong.

I have a player that has a rigidbody2d, is Dynamic (I’ve tried making it kinematic and using full kinematic as well) and is simulated. Here is a picture: Imgur: The magic of the Internet

The Objects that it is colliding with have these settings: Imgur: The magic of the Internet
Yes, I’ve tried not having a rigid body on them, and also have set them to Use Full Kinematic before as well when I do have them as a kinematic rigid body. It makes no difference, I still get no input on collision.

For the code for movement I’ve tried having it move through rb.Addforce and translating the objects position, both through fixed update.

I’ve checked the collision Matrixes and it seems to be in order as well, but here is a picture of that in case it may be messed up: Imgur: The magic of the Internet

The Script for detecting that is connected to the player is:

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

public class RowCollider : MonoBehaviour
{
	public static bool alive;

	void Start ()
	{
		alive = true;
	}

	void OnTriggerEnter2D (Collider2D other)
	{
		Debug.Log ("You Collided!");
		alive = false;
	}

	void FixedUpdate ()
	{
		Debug.Log (alive);
	}
}

I really have no idea how to get this to work, I’ve tried so many things, please help :cry:

Guys my bad, Apparently the collider boxes all shifted up for some reason when i made them prefabs, I had no idea :'(.

You have that script attached to the player object, correct? That’s your problem.

When a script has an OnTriggerEnter2D event function, that event is called when a trigger collider on the same object as the script is entered by another object (not when the script’s object enters a trigger collider). You need to put your trigger enter function on the trigger area object, not the player object.

Fixed things up a little, but hasn’t changed anything:
script :
Imgur

Object that is being collided against:
Imgur

Collision Matrix:
Imgur

Basically all that was changed was that the script was moved to the object being collided against rather than being on the player, and the player still has a dynamic rigid body and a box collider that isn’t a trigger.

Yet it appears that the script won’t even fire, regardless of anything to do with static variables it should at least send the debug message “You Collided!”

The player movement script, that is connected to the player works through rb. Addforce in a manner as so

rb.AddForce (transform.right * 1.5F);

If anyone knows what I’m doing wrong, please notify me.

I also had really a lot of problems when configuring the collision between game objects.
After years I wrote every tips in this article https://gamedevelopertips.com/unity-collision-detection-2d/, I’m sure it’ll be helpful if you want to set up properly you collider/triggers properly.