playMaker

Author Topic: [SOLVED] Unique material color / unique material instance for prefabs?  (Read 2950 times)

charming_fox

  • Junior Playmaker
  • **
  • Posts: 62
Hi,

I am struggling with a small issue and there's probably an easy solution. I am spawning in players who currently use the same model, I'd like them to be able to independently change their material color using the color variable, however when they do this it changes all objects in the scene that use the material.

Is there any way (and judging by the forums there is not unless I'm missing something) that I can achieve this? The only thoughts I have are dead-ends so far:

1 - Each player spawns with a set of their own materials which are independent
2 - Playmaker generates a material instance (doesn't appear to be possible)

Any help, much appreciated!

Thanks

Andy
« Last Edit: July 07, 2015, 01:11:30 PM by charming_fox »

DarkSoul

  • Playmaker Newbie
  • *
  • Posts: 37
Re: Unique material color / unique material instance for prefabs?
« Reply #1 on: July 07, 2015, 11:49:00 AM »
Hello ,

I guess you could do this [ScreenShoot]

I hope it helps.

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Unique material color / unique material instance for prefabs?
« Reply #2 on: July 07, 2015, 12:58:32 PM »
Yeah I think that if you leave the Material field empty on the Set Material Color action it will create an instance, otherwise it will change for everything using that material.

charming_fox

  • Junior Playmaker
  • **
  • Posts: 62
Re: Unique material color / unique material instance for prefabs?
« Reply #3 on: July 07, 2015, 01:02:43 PM »
Hi both, thanks for the help, I thought I did try this however I will give it another go in the morning and report back and hopefully add a [SOLVED] to the title!

Thanks again

charming_fox

  • Junior Playmaker
  • **
  • Posts: 62
Ok, I couldn't help but test it even though I'm not at work now... it works, and I feel a bit stupid, but thank you so much anyway!

For clarification for anyone reading this suffering the same level of daftness:

When using the "set material color" action, if you leave the 'material' field as 'none' then the action will only change that GameObject's color, however if you specify a material then the action will change the material and therefore anything in the whole scene with that material (even if you've specified a game object, I guess this gets overidden by the material setting if used).

I hope that makes sense and is correct, thanks again.