Search Unity

How to reset variables

Discussion in 'Scripting' started by Enderkill9, Apr 29, 2017.

  1. Enderkill9

    Enderkill9

    Joined:
    Apr 26, 2017
    Posts:
    39
    Code (CSharp):
    1.  
    2. public class statroll : MonoBehaviour {
    3.     int str = 0, agi = 0, inte = 0;
    4.  
    5.     public void RandomizeStats() {
    6.  
    Apparently I'm supposed to reset these variables before the function, but what code would I use.
     
  2. LovesSolvingProblems

    LovesSolvingProblems

    Joined:
    Jan 22, 2015
    Posts:
    17
    public void reset(){ str=0; agi=0; inte=0;}