so i want a gameObject to spawn whenever the spawn chance number is a certain number but i dont want decimals only whole numbers heres my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WaterBottleSpawnChance : MonoBehaviour {
public float WaterBottleSpawningChance;
public Transform WaterBottleSpawn;
public Transform WaterBottle;
// Use this for initialization
void Start () {
WaterBottleSpawningChance = Random.Range (1f, 2f);
if (WaterBottleSpawningChance == 2)
{
Instantiate (WaterBottle, WaterBottleSpawn.position, Quaternion.identity);
}
}
// Update is called once per frame
void Update () {
}
}