Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Spataar on September 28, 2014, 08:08:43 AM

Title: [SOLVED] Int Operator calculates incorrect answer?
Post by: Spataar on September 28, 2014, 08:08:43 AM
Hi all, I'm having issues with the INT Operator not calculating numbers correctly.

I have an FSM that gets two random INT's and then adds them up showing an answer. In certain instances it calculates incorrectly as per below.

This may be a silly question but i just can't figure it out....

(http://i.imgur.com/JOcMICJ.jpg)
Title: Re: Int Operator calculates incorrect answer?
Post by: Lane on September 28, 2014, 10:40:32 AM
The variables are probably changing after the operation is done.

Try using some predefined variables, if it is correct then that is probably the case. Maybe a loop in your random generation or something, or some event being fired twice? What else is going on in the context?
Title: Re: Int Operator calculates incorrect answer?
Post by: Spataar on September 28, 2014, 01:17:07 PM
Thanks, I figured it out - I use an array to shuffle the numbers which then end up overwriting the value. This is ok as I first save it into a separate variable and for my game to work this is necessary.