NullRefenceExiption Please help.

Hi Im getting 2 nullRefenceExition’s For this bit of code:

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

public class Sliding : MonoBehaviour
{
   [Header("Refences")]
   public Transform orientation;
   public Transform Player;
   private Rigidbody rb;
   private PlayerMovement3D pm;

   [Header("Sliding")]
   public float MaxSlideTime;
   public float SlideForce;
   private float SlideTimer;

   public float SlideYScale;
   public float StartYScale;

   [Header("Input")]
   public KeyCode SlideKey = KeyCode.LeftControl;
   private float horizontailInput;
   private float verticalInput;

   private bool sliding;

   void start()
   {
    rb = GetComponent<Rigidbody>();
    pm = GetComponent<PlayerMovement3D>();

    StartYScale = Player.localScale.y;
   }

   void Update()
   {
     horizontailInput = Input.GetAxisRaw("Horizontal");
     verticalInput = Input.GetAxisRaw("Vertical");

     if(Input.GetKeyDown(SlideKey) && (horizontailInput != 0 || verticalInput != 0))
     {
        StartSlide();
     }

     if(Input.GetKeyUp(SlideKey) && sliding)
     {
        StopSlide();
     }
   }

   void FixedUpdate()
   {
      if(sliding)
      {
         SlidingMovement();
      }
   }

   private void StartSlide()
   {
      sliding = true;

      Player.localScale = new Vector3(Player.localScale.x, SlideYScale, Player.localScale.z);
      rb.AddForce(Vector3.down * 5f, ForceMode.Impulse);

      SlideTimer = MaxSlideTime;
   }

   private void SlidingMovement()
   {
      Vector3 InputDirection = orientation.forward * verticalInput + orientation.right * horizontailInput;

      rb.AddForce(InputDirection.normalized * SlideForce, ForceMode.Force);

      SlideTimer -= Time.deltaTime;

      if(SlideTimer <= 0)
      {
        StopSlide();
      }
   }

   private void StopSlide()
   {
      sliding = false;

       Player.localScale = new Vector3(Player.localScale.x, StartYScale, Player.localScale.z);
   }

}

I know what lines are giving me the errors:
1: rb.AddForce(InputDirection.normalized * SlideForce, ForceMode.Force);
2: rb.AddForce(Vector3.down * 5f, ForceMode.Impulse);

I have set all the variables to what they are meant to be.
And the player object as the PlayerMovement3D script on it as well.

I dont know why im getting these errors.

(Sorry Im bad at spelling)

Nothing special here, start with step #1.

How to fix a NullReferenceException error

https://forum.unity.com/threads/how-to-fix-a-nullreferenceexception-error.1230297/

Three steps to success:

  • Identify what is null ← all actions taken before this step is complete are WASTED TIME
  • Identify why it is null
  • Fix that

Thanks you I found what was causing the error and fixed it.