Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Wayne191 on July 07, 2017, 12:18:42 AM

Title: Float Compare to 0 ? [SOLVED]
Post by: Wayne191 on July 07, 2017, 12:18:42 AM
Hi,

I am comparing a Variable A to 0 using Float Compare action. For some reason, all three events Equal, Less Than, Great Than got sent out. I even set a new float variable to be 0 and compare Variable A to the new float variable 0. It didn't work too.

How could that be possible? Anything I might did wrong?

Variable A: Subtract Variable B from Variable C

Thanks.
Title: Re: Float Compare to 0 ?
Post by: djaydino on July 07, 2017, 04:32:50 AM
Hi,
Can you show a picture from your state, i just tried on my end and it seems to work fine here
Title: Re: Float Compare to 0 ?
Post by: Wayne191 on July 07, 2017, 05:51:48 AM
Here is the screenshot. I also tried to make float 1 to be 0 after subtract and it didn't work as well.

Thanks djaydino. You are always very helpful.
Title: Re: Float Compare to 0 ?
Post by: djaydino on July 07, 2017, 01:18:31 PM
Hi,
I can see that you got a lot going on in this fsm :)

on the float compare,is the 'float 2' always 0?
If so click on the '=' and set 0 as value instead of using a variable.

Also if you right click on a state name, you can set a breakpoint.

This will pause the game when it reaches that state. but it will not execute it yet.
when you unpause, it will go to the next state.

You can set on the next ones also breakpoints so you can see where it goes next. (very usefull for debugging :) )

The 'Float Compare' action should be working.
Try on a new scene a simple setup with a float compare and see if that works.

i you can't find the problem, let me know.
Title: Re: Float Compare to 0 ?
Post by: Wayne191 on July 13, 2017, 06:05:11 AM
Found out the issue. Thanks for help.
Title: Re: Float Compare to 0 ?
Post by: djaydino on July 13, 2017, 06:08:48 AM
Hi.
No problem, what was the issue?
Title: Re: Float Compare to 0 ?
Post by: Wayne191 on July 13, 2017, 06:45:51 AM
There are lots of things going on in this FSM.

The float compare > and < were actually sent in two different cycles and two cycles are not through the same route. One of the variables is > 0 in the first cycle, but is <0 in the 2nd cycle. I thought both > and < were sent in the same cycle. Breakpoints are helpful.  :)

Title: Re: Float Compare to 0 ?
Post by: djaydino on July 13, 2017, 07:01:03 AM
Hi,
Breakpoints are indeed very helpfull also the 'debug' actions are usefull :)
Title: Re: Float Compare to 0 ?
Post by: tcmeric on July 13, 2017, 07:27:31 AM
I have a short youtube tutorial video that goes through 5 tips for debugging with playmaker. You may find it helpful as well:
Title: Re: Float Compare to 0 ?
Post by: Wayne191 on July 13, 2017, 11:08:44 PM
Thank you.