New to unity, how do I access a material's attributes?

Hello everyone,

I am brand new to unity, having just completed the roll a ball tutorial last week. The project I am now working on is to access a shader materials component (I think that is what a shader is) using a KORG nanoKontrol 2 midi controller. So far, I have found this project: GitHub - keijiro/MidiJack: MIDI input plugin for Unity which I have manipulated a little bit to be able to change the scales X, Y, and Z axis using the sliders on the controller (originally what the project does is allow you to change a single scale value, the Y axis).

However, since I am brand new I am lost as to where to go now. Here is a screenshot with the Shader values I am trying to manipulate:


And here is the code I have tampered with so far that is allowing me to manipulate the scale of X, Y, and Z:


I am assuming that you need to use something like SetWhatever from what I have read so far, but the attempts I made at using the different variations and/or where to place them ended in failure. Any guidance (more than the standard link to the materials help page because I have already read over it and still don’t get it) would be very helpful as I try and figure this out.

Thank you!

Material has a variety of Set methods in the API. Unity - Scripting API: Material

It looks like you are after SetFloat. There is a usage example on this page you should be able to adapt to your purposes. Unity - Scripting API: Material.SetFloat

Thanks, using that I was able to gain access to my values! Stoked to be making some progress finally. Two new questions, how would I be able to make that number operate between a certain range, and how could I apply this to a color value that has four different values to manipulate? Right now the sliders will only go between 0 and 1, but I need them to operate in between the values set in the shader, as well as somehow be able to access all four values in the color window. Below is the values I am trying to hone in on and my code so far. I am still a student in school so I still have lots to learn!