Playmaker Forum

Playmaker Feedback => Action Requests => Topic started by: jess84 on April 18, 2014, 11:53:07 AM

Title: Set Global Material
Post by: jess84 on April 18, 2014, 11:53:07 AM
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, 06: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, 09:51:26 AM
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, 10:17:21 AM
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, 10:27:20 AM
Cool, glad its working for you.
Title: Re: Set Global Material
Post by: Ubik3D on June 20, 2017, 03: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, 08: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, 10:29:39 AM
Hi,
If it is ok with Mash i can place it on the Ecosystem