I have the following function defined in my Global code:
- Code: Select all
void displayRowsMarket () {
Market_Row_1_Qty.textNumber=10;
ChangeAnimation("Market_Row_2", "Market_R_Power_Grey", FORWARD);
}
The following is my mouse down event (on another actor) that calls the above function.
- Code: Select all
displayRowsMarket();
On mouse down, the animation changes as expected, but the value of the number does not. It remains at 0 (the default value).
However, the number changes as expected if I add a comment above the function call in the mouse down event. The complete code within the mouse down event with which the number value changes properly is as follows:
- Code: Select all
//Market_Row_1_Qty.textNumber=30;
displayRowsMarket(costHandgun);
I had inserted the comment to check whether the code worked without the function call (and it did). I commented it out thereafter and noticed the code worked after I re-added the textNumber line of code the function call. Upon removing the comment, the code ceased to function as expected once again.
I have no idea why the above occurs and why a comment affects the way the code functions, but I'd sure like to find out.