playMaker

Author Topic: Game Design Video Tutorial 10: Set Material Color of Platforms  (Read 2478 times)

u0204909

  • Playmaker Newbie
  • *
  • Posts: 9
[UPDATED]

Pls refer to Game Design Video Tutorial 10 - Platform Puzzle Chest Opening Game.

Around 22 mins into the video, we are talking about changing material color of the platforms using Set Material Color.

I did the same thing, using the same prefabs provided by Playmaker. However, my platforms do not change color at the initial stage. I also tested the state locally by setting it as the start state. The initial color is always changed to black (which is the default value of Color variables without setup) at runtime even when I look at the global variables Color1, Color2, Color3, Color4 and they have indeed been set correctly at run-time.

It is possible that it is because the Set Material Color action runs before the Set Color1,2,3,4 actions in the GameManager? Though on the Playmaker Log, the Set Color actions run first before the Set Material Color.  [UPDATE: I have solved this problem by adding a 0.1second delay before Set Material Color on the platform so that the Color1,2,3,4 are initialised first. This means the problem is because of the sequence of actions ran on independent FSMs? Is there anyway I can prioritise the running of FSMs? Or do I need to do it manually like I have done here?

Thank you :)
« Last Edit: June 28, 2012, 10:55:25 AM by u0204909 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Game Design Video Tutorial 10: Set Material Color of Platforms
« Reply #1 on: July 02, 2012, 02:16:43 AM »
Hi,

 I am quite positive that you can achieve the same without implement delays. If you can share this prefab and a small scene to reproduce, I will be able to maybe spot the issue.

 you can't prioritize Fsm. You can order actions by sending events or reorganizing initialization so that all the data is there when a prefab starts. So for example have your four color ready and then create your prefabs.

Bye,
 
Jean

Gerrickg

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Game Design Video Tutorial 10: Set Material Color of Platforms
« Reply #2 on: August 24, 2013, 12:52:20 PM »
I know this is an old topic, but only starting to use Playmaker...went through tutorial 10 and am having same problem. once I make object a prefab...it will always make color of default material black. I even tried changing "set Material Color" to "set Property" and am bumping my head into the same problem.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Game Design Video Tutorial 10: Set Material Color of Platforms
« Reply #3 on: September 09, 2013, 03:16:06 AM »
Hi,

 Can you create a new scene, and a new material. and work from this. It's likely that in your scene, you may have conflicting behaviors, all trying to set the color of the same material. Or you could be editing one instance of the prefab, instead of the prefab itself, which would result in trouble and inconsistency.

 So, make sure that even the simpliest cube and material as a prefab behaves normally and we'll take it from there to solve this issue.

 Bye,

 Jean