Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Adam Z on March 13, 2019, 10:55:23 AM

Title: [SOLVED] Unitys Shadergraph Float access?
Post by: Adam Z on March 13, 2019, 10:55:23 AM
Hi, for some reason I can't access my Materials float when I created it with Shadergraph. Any thoughts?

Thanks.
Title: Re: Unitys Shadergraph Float access?
Post by: Adam Z on April 23, 2019, 06:53:56 PM
Hi, does anyone know of a solution? Thanks.
Title: Re: Unitys Shadergraph Float access?
Post by: Alex Chouls on April 23, 2019, 08:32:43 PM
I think shader graph mangles the names. This might help:
https://forum.unity.com/threads/im-having-trouble-accessing-shadergraph-exposed-properties-through-c-script.526398/
Title: Re: Unitys Shadergraph Float access?
Post by: Thore on April 24, 2019, 02:48:04 AM
I think shader graph mangles the names. This might help:
https://forum.unity.com/threads/im-having-trouble-accessing-shadergraph-exposed-properties-through-c-script.526398/

When a new property is added, it generates an inscrutable string, as visible on the second picture above. To access the property, you just need to define a name there (convention is _yourPropertyParameter).
Title: Re: Unitys Shadergraph Float access?
Post by: Adam Z on April 24, 2019, 07:36:25 AM
I think shader graph mangles the names. This might help:
https://forum.unity.com/threads/im-having-trouble-accessing-shadergraph-exposed-properties-through-c-script.526398/

Thanks
Title: Re: [SOLVED] Unitys Shadergraph Float access?
Post by: Adam Z on April 24, 2019, 07:41:26 AM
To be a bit more specific; when you create your shader with Unity's Shader Graph and add a parameter to the Blackboard, it generates a Reference ID (i.e. Texture2D_355C4C5). You can either use that, or rename it to whatever you'd like (it seems to put an _ before whatever you decide to name it). Just use your renamed Reference ID (i.e. _ThisIsRenamed)  in your Playmaker node and you should be good to go.

Thanks everyone.