I'm currently making my first game using using Unity3D written in C#. What I'm doing now is the part where the player can get different attack by chance. eg. if it's critical chance is set to 20%, then it'll make a critical damage.
My problem is it's random number generator is making the same output for eg. when it makes a critical damage, it also make a stun damage when the requirements are met. What I want is, there's a different random value for critical, stun, etc. I have read that I can use Random.Next, but It's not working in Unity3D even though it's both C#. This is what I've done
private float _criticalChance;
private float _stunChance;
// Use this for initialization
void Start() {
_criticalChance = Random.Range (0f, 1f);
_stunChance = Random.Range (0f, 1f);
}
Then I see in it's Debug.Log that it outputs the same value.