Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Pawel on July 03, 2013, 10:06:28 AM

Title: 0+1=2?!
Post by: Pawel on July 03, 2013, 10:06:28 AM
I am running into a strange issue. Not sure if it is a bug, or I got this wrong in my head...

I have thee Actions:

1) Get FSM Int (OtherInt variable from another FSM which I save to an int variable MyInt)

2) Int Add (add 1 to MyInt)

3) Set FSM Int (Variable name: OtherInt  Set Value: MyInt)

When I start, OtherInt typically is 0 -- this is also what it shows when I disable IntAd. However I never get 1 as a result of adding 1 to zero -- the OtherInt always shows 2 in the inspector...

Is it a bug or am I wrong in my logic?
Title: Re: 0+1=2?!
Post by: Lane on July 03, 2013, 10:52:06 AM
MyInt probably starts as 1.

Unless on your other fsm you're doing something that is adding to the number after between it being received from the IntAdd fsm.
Title: Re: 0+1=2?!
Post by: Pawel on July 03, 2013, 01:25:01 PM
The other object (empty) only has one action: Set Int... (variable "OtherInt" value: "0")

Besides once I deactivate the Int Add the inspector shows OtherInt as 0...

Since I have the object that has the 3 actions on a global event, my thought is that somehow the event is triggered more then once... This is what I am investigating now...