Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: jess84 on April 18, 2014, 02:53:07 PM

Title: Set Global Material
Post by: jess84 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)

?
Title: Re: Set Global Material
Post by: Marsh 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
Title: Re: Set Global Material
Post by: jess84 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)
Title: Re: Set Global Material
Post by: jess84 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  :)
Title: Re: Set Global Material
Post by: Marsh on April 19, 2014, 01:27:20 PM
Cool, glad its working for you.
Title: Re: Set Global Material
Post by: Ubik3D 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.
Title: Re: Set Global Material
Post by: finepointcgi on August 21, 2017, 11:59:59 AM
@Marsh This worked perfect for me thanks man! This should be added to the ecosystem.
Title: Re: Set Global Material
Post by: djaydino on August 21, 2017, 01:29:39 PM
Hi,
If it is ok with Mash i can place it on the Ecosystem