Random Roll

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

public class PerkCreator : MonoBehaviour
{
public Perks perk;
public int random;
public int currentperks;
public int maxperks;
public bool randombool;

void Start()
{
    maxperks = 3;
    CreatePerk();   
}

public void CreatePerk()
{
    for (int i = 0; i < randombool.Length; i++)
    {
        randombool _= randombool*;*_

int rng = Random.Range(1, 2);
if (rng == 2)
{
randombool = true;
currentperks++;
}
else
{
randombool = false;
}
Debug.Log(“works”);
}
perk = new Perks(perk, randombool[0], randombool[1], randombool[2], randombool[3], randombool[4]);
}
}
I’m trying to roll a number for each number of items in my list. To change the bools on my bonus system. It just rolls once than stops. I’m not sure why.

You are only calling CreatePerk() once in the Start() function, so the code will only run once. If you want this to run once every few seconds for example, you can make a timer in the update function or you can make this a coroutine using WaitForSeconds() in a while loop.

What is this line suppose to do?
randombool = randombool*;*
Anyway it only goes once because you never set randombool length so its 0, that means only one iteration.
+ i think all bools will be false all the time, since your random range goes from 1 to 1
you need to write Random.Range(1,3).