playMaker

Author Topic: Set Global Material  (Read 1001 times)

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Set Global Material
« 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)

?

Marsh

  • Full Member
  • ***
  • Posts: 227
  • Comfort the disturbed, disturb the comfortable
    • View Profile
Re: Set Global Material
« Reply #1 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

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: Set Global Material
« Reply #2 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)

jess84

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
Re: Set Global Material
« Reply #3 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  :)

Marsh

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

Ubik3D

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
    • www.hypnorama.se
Re: Set Global Material
« Reply #5 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.

finepointcgi

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

djaydino

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