Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: cel on January 05, 2013, 10:52:57 AM

Title: [SOLVED] help with send message
Post by: cel on January 05, 2013, 10:52:57 AM
I am trying to send a message every frame but there is no option in the action to do so....
I am adding a value to a float variable every second and trying to pass this variable to a script using send message (using it with simple way point system) but the variable isn't updated to the script...

Maybe if there was an option in the send message action to do it every frame??
Title: Re: help with send message
Post by: KozTheBoss on January 05, 2013, 03:30:14 PM
I don't know if it would work, but how about making a send message in a state and then have a FINISHED transition into a state that does the exact same thing and just loop them back and forth between the two.. maybe even put a wait state in there aswell :)
Title: Re: help with send message
Post by: Alex Chouls on January 05, 2013, 07:33:19 PM
You can use the Next Frame Event action to loop a state.

P.S. I'll add an every frame option to Send Message in the next update...

Title: Re: help with send message
Post by: cel on January 06, 2013, 06:11:10 AM
thanks alex, that worked perfectly....
Title: Re: help with send message
Post by: KozTheBoss on January 06, 2013, 09:58:01 AM
why didn't I think of that  ???
Title: Re: [SOLVED] help with send message
Post by: bizilux on December 29, 2013, 11:23:42 PM
has this ever been done?

i cant really use next frame event... because in the same state i have action "float interpolate"  so that state cant be restarted every frame...

"every frame" option would do wonders for me here...


im basically trying to slow down a car, gradually... sure there are other ways to do it, but this is the most elegant one i think
Title: Re: [SOLVED] help with send message
Post by: jeanfabre on December 30, 2013, 06:50:53 AM
Hi,

 The problem with this approach is that it's not performant at all, using "sendMessage" ( regardless the use of PlayMaker) is not a good idea to send everyframe.

Did you wrote that script you are sending events to or is it a framework you got from the asset store?

bye,

 Jean
Title: Re: [SOLVED] help with send message
Post by: bizilux on December 30, 2013, 08:37:05 AM
hey jean,

its framework from "simple waypoint system"  im using changespeed method to change speed of the car during runtime, so that when car detects obstacle, it slows down gradually and not straight to 0.

if every frame isnt an option, then i guess i could use float substract, and substract it by 0.1... and do that every frame...  and then clamp float value...

the problem is that you dont know how many frames per second the user on the phone will have... but okey i think its doable
Title: Re: [SOLVED] help with send message
Post by: jeanfabre on December 30, 2013, 09:16:12 AM
Hi,

 The other solution is to make a custom action that talk to simpleWaypoint framework efficiently.

Bye,

 Jean