CS0117 error

I’m very new to this, and am trying to get a sound when walking into a coin.
I was following this tutorial:

When running the code it gives me a CS0117 Error: ‘SoundManager’ does not contain a definition for ‘sdnMan’

Here is my ‘SoundManager.cs’ Code:

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

public class SoundManager : MonoBehaviour
{
    public static SoundManager sndMan;

    private AudioSource audioSrc;

    private AudioClip[] coinSounds;

    private int randomCoinSound;

    // Start is called before the first frame update
    void Start()
    {
        sndMan = this;
        audioSrc = GetComponent<AudioSource>();
        coinSounds = Resources.LoadAll<AudioClip>("CoinSounds");
    }

    public void PlayCoinSound()
    {
        randomCoinSound = Random.Range(0, 1);
        audioSrc.PlayOneShot(coinSounds[randomCoinSound]);
    }
}

And my Player Code:

using UnityEngine;

public class PlayerCtrl : MonoBehaviour
{
    Rigidbody2D body;

    float horizontal;
    float vertical;
    float moveLimiter = 0.7f;

  
    public float runSpeed = 8.0f;


    void Start()
    {
        body = GetComponent<Rigidbody2D>();
    }
   

    public Animator animator;

    void Update()       

        {
            // Gives a value between -1 and 1
            horizontal = Input.GetAxisRaw("Horizontal"); // -1 is left
            vertical = Input.GetAxisRaw("Vertical"); // -1 is down

            animator.SetFloat("MoveHor", horizontal);
            animator.SetFloat("MoveVer", vertical);


    }

    void FixedUpdate()
    {
        if (horizontal != 0 && vertical != 0) // Check for diagonal movement
        {
            // limit movement speed diagonally, so you move at 70% speed
            horizontal *= moveLimiter;
            vertical *= moveLimiter;
        }

        body.velocity = new Vector2(horizontal * runSpeed, vertical * runSpeed);
    }

    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.CompareTag("Coins"))
        {
            Destroy(other.gameObject);
            SoundManager.sdnMan.PlayCoinSound();
        }
    }

   

}

I’m not sure how to solve this. Appreciate it in advance

Looks like you have a typo:
SoundManager.sdnMan.PlayCoinSound();
sdnMan is not the same as the variable you defined: sndMan
Remember, if the compiler tells you it doesn’t exist the first thing you should be doing is checking the spelling of your variables.

Steps to success:

  1. stop making typos

or

  1. learn how to read the error messages so you can fix them yourself

The complete error message contains everything you need to know to fix the error yourself.

The important parts of the error message are:

  • the description of the error itself (google this; you are NEVER the first one!)
  • the file it occurred in (critical!)
  • the line number and character position (the two numbers in parentheses)
  • also possibly useful is the stack trace (all the lines of text in the lower console window)

Always start with the FIRST error in the console window, as sometimes that error causes or compounds some or all of the subsequent errors. Often the error will be immediately prior to the indicated line, so make sure to check there as well.

All of that information is in the actual error message and you must pay attention to it. Learn how to identify it instantly so you don’t have to stop your progress and fiddle around with the forum.

Remember: NOBODY here memorizes error codes. That’s not a thing. The error code is absolutely the least useful part of the error. It serves no purpose at all. Forget the error code. Put it out of your mind.