playMaker

Author Topic: 10 - Platform Puzzle Chest Opening Game (Set Color Value)[SOLVED]  (Read 2401 times)

kuhnen

  • Playmaker Newbie
  • *
  • Posts: 3
I'm following along this tutorial but I reached a problem.

I created global color variables (which are defaulted to black) and on the setup stage on an FSM I used "Set Color Value" to give another color to the global color variables. In another FSM I have an action to Change Material Color amd select the global variable as the color, but when I run the game, it changes to the default color (black) and not to the color that I used on the "Set Color Value" action. If I change the color on the global variable itself, then it works fine. Apparently it's the "Set Color Value" action that is not working. Any ideas?

Attached pictures of my FSM.

:(
« Last Edit: October 22, 2013, 07:25:54 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: 10 - Platform Puzzle Chest Opening Game (Set Color Value)
« Reply #1 on: October 22, 2013, 02:27:45 AM »
Hi,

 maybe the fsm where you set the material color is fired before the fsm where you set the color?

 Try to create a global event, that you fire when you have changed the colors, just to make sure, especially when both wants to do its job on start, it's always going to be a race condition issue.

bye,

 Jean

kuhnen

  • Playmaker Newbie
  • *
  • Posts: 3
Re: 10 - Platform Puzzle Chest Opening Game (Set Color Value)
« Reply #2 on: October 22, 2013, 07:06:39 AM »
Hey thanks a lot for the reply! Setting a global event didn't seem to work :(

But I followed your advice about the racing condition and added a very small delay before the change material action, and it worked. ;)

Thanks again!