Quantcast
Channel: Questions in topic: "invokerepeating"
Viewing all articles
Browse latest Browse all 220

I'm having trouble with InvokeRepeating in my 2D game.

$
0
0
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; } }

Viewing all articles
Browse latest Browse all 220

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>