Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Adam Z on March 13, 2019, 01:55:23 PM
-
Hi, for some reason I can't access my Materials float when I created it with Shadergraph. Any thoughts?
Thanks.
-
Hi, does anyone know of a solution? Thanks.
-
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/
-
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).
-
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
-
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.