playMaker

Author Topic: Set Global Material  (Read 4427 times)

jess84

  • Hero Member
  • *****
  • Posts: 515
Set Global Material
« on: April 18, 2014, 02:53:07 PM »
Would a custom action be possible, like Set Game Object but with the following two options;

Set Global Material:

 Variable (dropdown list)
 Material (drag material from assets window)

?

Marsh

  • Full Member
  • ***
  • Posts: 227
  • Comfort the disturbed, disturb the comfortable
Re: Set Global Material
« Reply #1 on: April 19, 2014, 09:16:51 AM »
Not 100% sure what you want but from what you described? Try this?

http://pastebin.com/RbyUgEk1

Create a c# script and call it: SetGlobalMaterial

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Set Global Material
« Reply #2 on: April 19, 2014, 12:51:26 PM »
Thanks for that!

I'm testing now.

Firstly though, there's a conflict with an existing Action...

Assets/PlayMaker/Actions/SetMaterial.cs(9,22): error CS0101: The namespace `HutongGames.PlayMaker.Actions' already contains a definition for `SetMaterial'

(I've called yours SetGlobalMaterial)

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Set Global Material
« Reply #3 on: April 19, 2014, 01:17:21 PM »
I just renamed that problematic reference, and it's fine now.

The action works perfectly, and is exactly what I was after... thanks so much!!

This is a really useful one for doing A/B visual tests - such a time saver. I'd say this should probably be included in the official actions  :)

Marsh

  • Full Member
  • ***
  • Posts: 227
  • Comfort the disturbed, disturb the comfortable
Re: Set Global Material
« Reply #4 on: April 19, 2014, 01:27:20 PM »
Cool, glad its working for you.

Ubik3D

  • Playmaker Newbie
  • *
  • Posts: 22
    • www.hypnorama.se
Re: Set Global Material
« Reply #5 on: June 20, 2017, 06:21:48 AM »
One can also use the slightly more advanced "Set FSM Material" already included in the standard actions.

finepointcgi

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Set Global Material
« Reply #6 on: August 21, 2017, 11:59:59 AM »
@Marsh This worked perfect for me thanks man! This should be added to the ecosystem.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Set Global Material
« Reply #7 on: August 21, 2017, 01:29:39 PM »
Hi,
If it is ok with Mash i can place it on the Ecosystem