Hello
I am currently trying to change a variable, which is in the argument of my function, and set the value of the variable in my argument to the value of the variable in the function. Apologies if I have not clearly articulated my question. Here is an example.
Here are 2 segments of my code :
float SetDifficulty (float Difficulty)
{
Difficulty = (float)(Stage)-0.5f;
Debug.Log("Difficulty : " + Difficulty);
return Difficulty;
}
and
SetDifficulty(P1.Difficulty);
What I am trying to do is to set P1.Difficulty to what the result of Difficulty is in my function. In my console, Difficulty is 0.5 in the function SetDifficulty, however P1.Difficulty is always 0.
If anyone can assist, it would be a great help.
Thank you in advance