spawn game object in random position

//hello i am building an AR app and trying to spawn game object in random position but i can’t find the solution any help ? thank you ,hello , i am building an AR app and trying to spawn a game object in a random position but i can’t find the solution any ideas ? //
//code//
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class spawnscript : MonoBehaviour
{
public Transform spawnPoints;
public GameObject balloons;

// Start is called before the first frame update
void Start()
{
    StartCoroutine(Startspawning());
}

IEnumerator Startspawning(){
    yield return new WaitForSeconds(4);

    for (int i = 0 ; i < 3 ; i++){
        Instantiate(balloons_, spawnPoints*.position, Quaternion.identity);*_

}
StartCoroutine(Startspawning());
}
}
,

Hi @jassemdegani,

So your spawn position is Vector3 if dealing with 3D or Vector2 if 2D. Each of them consist of float values.
So for 3D:

[Serializefield] Vector3 m_maxPosition;
[Serializefield] Vector3 m_minPosition;

public void GetNewSpawPosition()
{
 return new Vector3(Random.Range(m_minPosition.x, m_maxPosition.x), Random.Range(m_minPosition.y, m_maxPosition.y, Random.Range(m_minPosition.z, m_maxPosition.z));
}

So in inspector you will need to assign min and max values. Hope will work for you. Sry for mistakes in speling (editing on phone )