Sorta new to scripting (can read a script and understand it, but unsure of how to make one myself). I’m trying to write a script for nodes of minerals, such as Ore for mining in a game that you can gather from them.
I know I want to write something that would set the ore to be “alive” on awake, and then when it is gathered, or “killed”, destroy it, then start a respawn timer, and then when the respawn timer hits 0, make it spawn that object to a certain point again.
I figure my variables would look something like this:
var respawnTimer : float = 10;
var orePrefab : Transform;
var spawnPoint : Transform;
var oreDead : boolean = false;
… Now, I’m not sure where to start, or what it would look like, or if I’m even missing some key variables… any tips?