Hello I wanted to ask how can I perform a substraction of 5 variables that are constantly being changed from a float function. Here is some code so you can understand what I mean:
float x = 1;
float y = 1;
float z = 1;
float g = 1;
float i = 1;
float Total
void Update()
{
Total = SubstractVariables(Total);
g++;
}
public float SubstractVariables(float SubstractionResult)
{
SubstractionResult = SubstractionResult - x - y - z - g - i;
return SubstractionResult
}
This currently substracts every frame those 5 variables, so they decrease every frame. What i want to achieve is make this substract dynamically. Any help is kindly appreciated!