Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: jgalvezpa on November 08, 2013, 11:30:00 PM

Title: How to add a Shader
Post by: jgalvezpa on November 08, 2013, 11:30:00 PM
Hello sorry for the newbie question it is my 1st time with shaders, i bought a glow plugin that bring lot of shaders, i want to know how can i apply it in my fsm.
for example i want that when i click an object it start glowing
Thanks
Title: Re: How to add a Shader
Post by: Blitztron on November 09, 2013, 02:41:33 AM
Hav you tried using Set Material?
Title: Re: How to add a Shader
Post by: parallel on November 09, 2013, 05:12:07 AM
Create a material, choose the shader (in the drop down list) and then assign material either beforehand or at runtime with 'set material'.
Title: Re: How to add a Shader
Post by: jgalvezpa on November 09, 2013, 02:12:36 PM
yes but im using 2D sprites with transparency when i apply a shader somethings appear a black or white image in my sprite
Title: Re: How to add a Shader
Post by: pottering on November 09, 2013, 05:23:33 PM
I'm a noob, but I think that "2D" in Unity is usually a 3D object with a texture/material of a image of a 2D sprite, so when you apply the shader it changes the texture/material and your 2D sprite disappears with it.
I'm guessing it is not really a Playmaker problem, but probably the way the shader was programmed.
Title: Re: How to add a Shader
Post by: jgalvezpa on November 11, 2013, 01:35:49 AM
i want to change the shader of a game object in the fsm, not the material how can i achieve that?
Title: Re: How to add a Shader
Post by: jeanfabre on November 11, 2013, 01:41:17 AM
Hi,

 You simply can't, Unity doesn't work like that. Shaders belongs to materials, so if you want to change a GameObject shader, you have to switch material.

bye,

 Jean