SpriteRenderer producing UnassignedReferenceError

For some reason my SpriteRenderer is not working and is producing a UnassignedReference Exception. I am creating a 2.5D game using 2D sprites in a 3D environment. Can anyone tell me why this isn’t working? My code is included and another image shows the script assigned to the player object.

You didn’t assign it in the inspector

Hi you need to Drag and drop the required spriterenderer on the inspector window