Instead of swapping gameobjects I'm actually trying to change the value of the fresnel strength in C# but my code keeps saying that property doesn't contain a float or range property Like this is the error message: Material 'highlight_herb_grand (Instance)' with Shader 'Shader Graphs/highlight' doesn't have a float or range property 'multiply_potencia' UnityEngine.Material:GetFloat (int) Also when I try to access the float data for that property y says its float value it's 100.0f when its actually 0.0f
Could you share me the Script, I found some error like "Assets\TutorialInfo\Scripts\Editor\MeshHighlighter.cs(23,29): error CS1061: 'MeshRenderer' does not contain a definition for 'enable' and no accessible extension method 'enable' accepting a first argument of type 'MeshRenderer' could be found (are you missing a using directive or an assembly reference?)" How to fix this Bro.
I know this is a bit late, but perhaps you are using the word 'enable' when you mean to be using 'enabled'. Every Component of a game object has a property named 'enabled', including the MeshRenderer. You'll get an error if you try to disable the Transform, but otherwise you can toggle any component (that I know of) this way.
@@GameAcademySchool I'm extremely new the shaders and shader-graph, but based on this unity documentation (docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Branch-Node.html) it would seem that with the Branch Node you mentioned, the shader code on the branch is calculated even if it isn't used. Wouldn't that be non-ideal performance-wise, especially if you want this highlight effect to be possible for all clickable objects or something (i.e. all those objects are now constantly performing the fresnel calculations every frame even though they aren't moused over)? Would @psychlght suggestion of having two different materials that are swapped be more performant in such a case? In particular since this kind of swap is happening only rarely (e.g. say at most once per second or once every 60 frames).
@@aronbroom7977 that doesn’t sound correct. View the latest version of the documentation which says “Both sides of the branch will be evaluated in the shader, and the branch not used will be discarded.” They said as much in one of their tech talks at Unite.
@@GameAcademySchool Thanks for the response! I didn't realize I was on an older version of the documentation. Tested this with 4000 objects going back and forth between a shader with no branch-node and one with a branch-node turned off, and indeed the performance is exactly the same :)