Error when calling method with animation and rigidbody2d from another script

Greetings
I am working on a game where I am having a little difficulty.

I have a game object at the foot of my player and when I ray Cast to it, if it’s touching a certain platform I want to call a separate and invoke a method.
Now this is the script im calling and it is attached to the platform

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

public class PlatformFall : MonoBehaviour
{

    public float fallDelay = 0.5f;

      Animator anim;
  
    private Rigidbody2D rb2d;

    void Awake()
    {    
        anim = GetComponent<Animator>();
        rb2d = GetComponent<Rigidbody2D>();
    }

    void OnCollisionEnter2D(Collision2D other)
    {
        Debug.Log(other.gameObject.tag);
        GameObject childObject = other.collider.gameObject;
        Debug.Log(childObject);
        if (other.gameObject.CompareTag("Feet"))
        {
            anim.SetTrigger("PlatformShake");
        
           Invoke("Fall", fallDelay);

            // destroy the Log
            DestroyObject(this.gameObject,4);
        }
    }
   public void startFall()
    {
        anim.SetTrigger("PlatformShake");

        Invoke("Fall", fallDelay);

        // destroy the Log
        DestroyObject(this.gameObject, 4);
    }
    void Fall()
    {
        rb2d.isKinematic = false;
        rb2d.mass = 15;
    }



}

Then in my other script which is attached to my character .

public class CharacterController2D : MonoBehaviour {
    //JummpRay Cast
    public PlatformFall platfall;
    // LayerMask to determine what is considered ground for the player
    public LayerMask whatIsGround;
    public LayerMask WhatIsFallingPlatform;

    // Transform just below feet for checking if player is grounded
    public Transform groundCheck;

....
...
Update(){
        //    Ray Casting to Fallingplatform

        isFallingPlatform = Physics2D.Linecast(_transform.position, groundCheck.position, WhatIsFallingPlatform);
        if (isFallingPlatform)
        {
            Debug.Log("Here");
            platfall.startFall();
        }
        Debug.Log(isFallingPlatform);

The Problem

My problem is, when my player touches the “platform” where message “Here” appears in the debug log along with the error"
UnassignedReferenceException: The variable anim of PlatformFall has not been assigned.
You probably need to assign the anim variable of the PlatformFall script in the inspector.
and if I comment out anim.SetTrigger I get
UnassignedReferenceException: The variable rb2d of PlatformFall has not been assigned.
You probably need to assign the rb2d variable of the PlatformFall script in the inspector.

I am not entirely sure why I am getting this error because my animator and rigidbody2d is set in the inspector of the fallingplatform and when I use the OnCollisionEnter2D it works fine. but calling platfall.startFall() from my other script is what’s giving the error.

Any help would be appreciated.
Thank you

Im having the same problem here i already attached the player’s rigidbody2d. when i click move from the button it says

issingComponentException: There is no ‘Rigidbody2D’ attached to the “avanzar” game object, but a script is trying to access it.
You probably need to add a Rigidbody2D to the game object “avanzar”. Or your script needs to check if the component is attached before using it.
UnityEngine.Rigidbody2D.set_velocity (UnityEngine.Vector2 value) <0x40079510 + 0x0005a> in <56d97623d55649feaec409bbd2aec743>:0
Botones.avanzar () (at Assets/botones nivel 1/Botones.cs:42)
UnityEngine.Events.InvokableCall.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:166)
UnityEngine.Events.UnityEvent.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_0.cs:58)
UnityEngine.UI.Button.Press () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:66)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Button.cs:108)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:50)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:261)

THIS IS MY CODE (incomplete)

public GameObject player;
public float velocity = 2f;
public Rigidbody2D rb2d;

public void avanzar()
{
player.SendMessage(“UpdateState”, “avanzar”);
Debug.Log(“boton derecha”);
var rb2d = GetComponent();

// rb2d = GetComponent();
rb2d.velocity = Vector2.left * velocity;

}