OnCollisionEnter2D not triggered

when I use a OnCollisionEnter2D it isn’t triggered, here is my code

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

public class PlayerController : MonoBehaviour
{
public float moveSpeed = 5f;

public Rigidbody2D rb;
public Animator animator;

Vector2 movement;

// The Problem
private void OnCollisionEnter2D(Collision2D collision)
{
    print("It Worked");
}

// Not the problem just my character controller
void Update()
{
    movement.x = Input.GetAxisRaw("Horizontal");
    movement.y = Input.GetAxisRaw("Vertical");

    animator.SetFloat("Horizontal", movement.x);
    animator.SetFloat("Vertical", movement.y);
    animator.SetFloat("Speed", movement.sqrMagnitude);
}

void FixedUpdate()
{
    rb.MovePosition(rb.position + movement.normalized * moveSpeed * Time.fixedDeltaTime);
}

}`

and here are some screenshots of the two objects that are supposed to collide

Edit : the code sample doesn’t get formatted for some reason

an OnCollisionEnter2D isnt triggered you can try using OnTriggerEnter2D . for this you will need to make the collider on which your script is sitting on to “isTriggered”

In order to use Ontrigger, make sure to turn on the trigger button on at least one obejct

What I meant was that it wasn’t getting called when something collided