playMaker

Author Topic: Send message doesn't updates color value inside itself  (Read 730 times)

turbososna

  • Playmaker Newbie
  • *
  • Posts: 2
Send message doesn't updates color value inside itself
« on: April 23, 2021, 12:53:24 PM »
Hi!

Please help with a problem with "Send message":

My task is to animate color parameter at custom outline component. So I'm using custom C# script, which contains custom method to set an outline color (parameter).

In my FSM I've got state with three PlayMaker operators:

1. Animate Color
which change value of local FSM variable 'Color' from red to green in 2 seconds

2. Send message
which sends current value of 'Color' variable to custom C# script (and here is the problem)

3. Wait
waiting 2 seconds to complete animation of 'Color' variable

so the problem is that 'Send message' doesn't get current value of 'Color' variable ( it updates color value only if manually reselect variable from dropdown list of local variables ). For example: if initial value of 'Color' was red, it stays red all the time, even if color of 'Color' variable already changed in FSM variables window from red to green. So the result is that color of outline parameter changing once, instead of smooth animation.

Am I doing something wrong or is there some problems with 'send message'? It's a bit strange that I need to reselect variable from dropdown list, to update the color value inside 'Send message'. With float type it updates fine without manual operations.

Thanx!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Send message doesn't updates color value inside itself
« Reply #1 on: April 23, 2021, 04:12:08 PM »
Hi.
does the value that you send need to be updated every frame?
as i think that might be the issue.

maybe you can use 'Set Properties' instead of send message?

turbososna

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Send message doesn't updates color value inside itself
« Reply #2 on: April 24, 2021, 06:41:19 AM »
Hi. Thanks for your reply!

Unfortunately 'set property' can't help, because my outline component isn't unity native.
And yes - it's not good idea to use 'send message' to update parameter every frame. Working too slow.

The only way I found is to use 'send message' as trigger for additional C# script, which updates the parameter every frame.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Send message doesn't updates color value inside itself
« Reply #3 on: April 24, 2021, 07:44:37 PM »
Hi.
Maybe you can create a custom action for it?

Have a look to this video :