Hello. I found some code on the Unity forums, from the post from GaborD here
The code is:
if (GUI.RepeatButton (Rect (xxx,yyy,215,55), colorPicker)) {
pickpos = Event.current.mousePosition;
aaa = pickpos.x-xxx-9;
bbb = pickpos.y-yyy-5;
col = colorPicker.GetPixel(aaa,41-bbb);
model.materials[matnum].SetColor("_Color",col);
}
I have gotten these errors:
Unknown identifier: 'xxx'
I added var xxx;
to the top, then got
Unknown identifier: 'yyy'
I added var yyy;
to the top, then got
Unknown identifier: 'colorPicker'
I added var colorPicker;
to the top, then got
Unknown identifier: 'model'
I added var model;
to the top, then got
Unknown identifier: 'colorPicker'
I added var colorPicker;
to the top, then got
model.materials[matnum].SetColor("_Color",col);
I added var model : Transform;
to the top, then got
So I am assuming this is where you drop the model or prefab I want to control the color of. But how do I do this right? Am I doing any of this right? Should I assign anything to those variables, `xxx`, `yyy`, and `colorPicker`? Thank you!