When I start the game the variable gets 1+ but that's it. I want it to repeat.
Here's the code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Population : MonoBehaviour
{
public int population;
public int rate;
// Start is called before the first frame update
void Start()
{
InvokeRepeating("PopulationAdd", 0.3f, 0.3f);
}
// Update is called once per frame
void Update()
{
}
void PopulationAdd()
{
population =+ 1;
}
}
↧