playMaker

Author Topic: [SOLVED] Unitys Shadergraph Float access?  (Read 3641 times)

Adam Z

  • Full Member
  • ***
  • Posts: 207
[SOLVED] Unitys Shadergraph Float access?
« 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.
« Last Edit: April 24, 2019, 10:36:46 AM by Adam Z »

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: Unitys Shadergraph Float access?
« Reply #1 on: April 23, 2019, 09:53:56 PM »
Hi, does anyone know of a solution? Thanks.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Unitys Shadergraph Float access?
« Reply #2 on: April 23, 2019, 11:32:43 PM »

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: Unitys Shadergraph Float access?
« Reply #3 on: April 24, 2019, 05: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).

Adam Z

  • Full Member
  • ***
  • Posts: 207

Adam Z

  • Full Member
  • ***
  • Posts: 207
Re: [SOLVED] Unitys Shadergraph Float access?
« Reply #5 on: April 24, 2019, 10: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.