Mannequin stand up right

so, I’m working a horror game and I have a mannequin appear when your sanity gets low enough it’s supposed to stand there and over time it disappears if player does not interact with it, if the player does interact with the mannequin grabs them and snaps their neck. the problem is sometimes spawns on location that are not flat the mannequin model lays on the ground instead of standing upright any suggestions to keep them up right?

using UnityEngine;
using UnityEngine.AI;

public class MannequinAI1 : MonoBehaviour
{

    public Transform player;

    public LayerMask whatIsGround, whatIsPlayer;

    public GameObject Mannequin;


    //Attacking
    public float timeBetweenAttacks;
    bool alreadyAttacked;

    //States
    public float collisionRange, attackRange;
    public bool playerInCollisionRange, playerInAttackRange;

    private void Update()
    {
        //Check for sight and attack range
        playerInCollisionRange = Physics.CheckSphere(transform.position, collisionRange, whatIsPlayer);
        playerInAttackRange = Physics.CheckSphere(transform.position, attackRange, whatIsPlayer);

        if (playerInAttackRange && playerInCollisionRange) AttackPlayer();
        else if (!playerInCollisionRange) Mannequin.SetActive(false);
    }

    private void AttackPlayer()
    {

        transform.LookAt(player);

        if (!alreadyAttacked)
        {
            ///Attack code here
            //Rigidbody rb = Instantiate(projectile, transform.position, Quaternion.identity).GetComponent<Rigidbody>();
            //rb.AddForce(transform.forward * 32f, ForceMode.Impulse);
            //rb.AddForce(transform.up * 8f, ForceMode.Impulse);
            FirstPersonController.OnTakeDamage(100);
            ///End of attack code

            alreadyAttacked = true;
            Invoke(nameof(ResetAttack), timeBetweenAttacks);
        }
    }
    private void ResetAttack()
    {
        alreadyAttacked = false;
    }

    private void OnDrawGizmosSelected()
    {
        Gizmos.color = Color.red;
        Gizmos.DrawWireSphere(transform.position, attackRange);
        Gizmos.color = Color.yellow;
        Gizmos.DrawWireSphere(transform.position, collisionRange);
    }
}

if you don’t want it to rotate at all you use the rigidbody constraints in the inspector, if you want it to be able to spin you constrain the x and z rotation, but not the y. If your model is spawning in rotated, then it’s orientation is not set up correctly, you can edit this in a 3d program, or you can rotate it in code.