holo object in skript edit text code example
Example: how to make % posibility to spawn an object C# in unity
public class RandomTimeSpawner : MonoBehaviour { //Spawn this object public GameObject spawnObject; public float maxTime = 5; public float minTime = 2; //current time private float time; //The time to spawn the object private float spawnTime; void Start(){ SetRandomTime(); time = minTime; } void FixedUpdate(){ //Counts up time += Time.deltaTime; //Check if its the right time to spawn the object if(time >= spawnTime){ SpawnObject(); SetRandomTime(); } } //Spawns the object and resets the time void SpawnObject(){ time = minTime; Instantiate (spawnObject, transform.position, spawnObject.transform.rotation); } //Sets the random time between minTime and maxTime void SetRandomTime(){ spawnTime = Random.Range(minTime, maxTime); } }