start game with coroutine walk into room

So, I’m trying to get a script to play a animation at the start of the game but nothing happens and no errors any ideas

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

public class startgame : MonoBehaviour
{
    [Header("Functional Options")]
    [SerializeField] public Animator anim1;
    [SerializeField] public GameObject obj1;
    [SerializeField] public Animator anim2;
    [SerializeField] public GameObject obj2;
    [SerializeField] public bool enter = false;
    [SerializeField] public bool isOpen = false;
    [SerializeField] public bool snapsneck = false;
    [SerializeField] public float SanitySubAmount = 25f;
    [SerializeField] public AudioClip SoundToPlay;
    [SerializeField] public float Volume;
    [SerializeField] private new AudioSource audio;
    [SerializeField] public bool alreadyPlayed = false;

    void Start()
    {
         anim1 = obj1.GetComponent<Animator>();
         anim2 = obj2.GetComponent<Animator>();
         audio = GetComponent<AudioSource>();
         StartCoroutine(starting());
    }

    IEnumerator starting()
    {
        obj1.GetComponent<FirstPersonController>().enabled = false;

        enter = !enter;
	    anim1.SetBool("enter", enter);

        yield return new WaitForSeconds(2);

        isOpen = !isOpen;
	    anim2.SetBool("isOpen", isOpen);
        audio.PlayOneShot(SoundToPlay, Volume);
        alreadyPlayed = true;
        anim1.enabled = false;
        FirstPersonController.sanityLevel -= SanitySubAmount;
        obj1.GetComponent<FirstPersonController>().enabled = true;
    }
}

Hi @rayith

Has this component / script been added to a game object in the loaded scene?

Have you validated the starting() coroutine has actually started (via debug log)?

Does the audio clip one shot play?

Have you validated that the idle animation clip (which is active before anything else happens) is active?

Have you validated that the ‘enter’ boolean in the animation is linked to the resulting animation correctly?

Have you validated that the ‘isOpen’ boolean in the animation is linked to the resulting animation correctly?