Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Mikael1987 on February 04, 2014, 03:36:30 PM

Title: Animations not reacting correctly to the touch.
Post by: Mikael1987 on February 04, 2014, 03:36:30 PM
(http://imageshack.com/a/img716/1226/4agn.png)
Given this FSM my little guy isnt playing the runningleft and runningright animations properly.
-In the wait for input state when i keep the touchscreen pressed it enters the charging state,after that i get X value of the touch.
-In the checkside I check that value against the Width of the screen,if i tapped to the left of the value EX:screen width is 480,480/2=240,with this i check if the tap is < or > than 240 to decide which side I should run,but it doesnt enter properly,its just  very random. Any idea and thanks in advanced!
PS:Also,is there an input to keep the touchscreen pressed? the charging state always ends at 1(it goes up from 0 in like 1 second).I'm using input touches asset.
Title: Re: Animations not reacting correctly to the touch.
Post by: jeanfabre on February 05, 2014, 04:27:29 AM
Hi,

 Have you properly set up the scene to react to touch the way ou want? In short, do you get the global events called at least?

bye,

 Jean
Title: Re: Animations not reacting correctly to the touch.
Post by: Mikael1987 on February 05, 2014, 02:48:56 PM
I'm not quite sure what you mean,In the animator I've got a "Direction" Variable that with a threshold from -1 to 1 -1 being left,0 forward and 1 right. On my FSM i set that variable accordingly to a value of -1 in the "RunningLeft" event and 1 on the "RunningRight" event,then after the "CHARGING END" event ends and goes back to "StartRunning" I set the "Direction" to 0 so it playes the forward animation.
Maybe I'm missing something?.
Title: Re: Animations not reacting correctly to the touch.
Post by: jeanfabre on February 11, 2014, 12:29:57 PM
Hi,

I think it's logical issue in your Fsm Flow.

 Can you pm me with this fsm and I'll try to see what's wrong there.

Also, starting from scratch sometimes helps. Build it step by step, it's sometime saves you a lot of time as opposed to trying to sort something big but messy.

bye,

 Jean