hey there
Today i wanted to try to have two variables calculated and the result being set in another variable..
So i have the code for the two variables i want to calculate:
if(DropStoneType.value == 15){
AC.GlobalVariables.SetFloatValue (13, 285.71f, true);
and
if(DropStoneQuantity.value == 6){
AC.GlobalVariables.SetIntegerValue (21, 7, true); Now i want them to be multiplied with each other and send the result to the variable with ID 9. However, how would i do that calculation of the two vars in a Unity C# script?
Comments
float v1 = AC.GlobalVariables.GetFloatValue(13)
[var:13] * [var:21]
Sadly i haven't gotten it to work with that yet. The v3 variable just stays empty.
Does that code go into Start()?
It should since i need to initiate those variables first, right?
and after etc. try to see whats going on - the wonderful world of debug awaits XD
p.s. you might have to do some casting from strings to floats and vice verser
I wanted to do this in a script because it is a LOT to write in the action list and it gets very confusing.. In a script it is, at least for me, much easier to see how things are done