error CS0246: The type or namespace name 'PlayerData' could not be found

I was following the brackeys tutorial on saving and loading

and i got this error and have been fiddling with it for the past hour and can’t seem to fix it

Assets/SaveSystem.cs(20,19): error CS0246: The type or namespace name ‘PlayerData’ could not be found (are you missing a using directive or an assembly reference?)

I have no clue what is wrong with my code!
(My Code)

using UnityEngine;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;

public static class SaveSystem{


    public static void SavePlayer(PlayerMovement Player)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string path = Application.persistentDataPath + "/player.playermonoscript.binaryconvert";
        FileStream stream = new FileStream(path, FileMode.Create);

        PlayerData data = new PlayerData(Player);

        formatter.Serialize(stream, data);
        stream.Close();
    }

    public static PlayerData LoadPlayer()
    {
         string path = Application.persistentDataPath + "/player.playermonoscript.binaryconvert";
         if (File.Exists(path))
         {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream stream = new FileStream(path, FileMode.Open);

            PlayerData data = formatter.Deserialize(stream) as PlayerData;
            stream.Close();
       
            return data;
         }
         else
         {
            Debug.LogError("Save file not found in " + path);
            return null;
         }
    }
}

Just to get that right, you’re following a tutorial that is 18 minutes long and you have this issue for over 60 minutes now. For sure you have rewatched the video 3 times by now, right? I don’t get how you can have missed that’s happening at 4 minutes and 15 seconds. Here he creates the PlayerData class. Since your error tells you that there is no PlayerData type in your current project, you must have skipped that part, somehow.

Though regardless of this issue, I would not recommend this tutorial, even though Brackey’s has a lot great tutorials, this one is not one of them. You should not use the BinaryFormatter anymore since it’s a security risk and even Microsoft strongly recommends to not use it anymore. You may want to look up a json tutorial instead.