#yes im creating it with script and then
1 messages · Page 1 of 1 (latest)
I'm not seeing those properties on any default materials.
Create a default material with default shader from scratch and test on that
now just set color through Material.color
yes
also note when you access .material property for the first time , it creates a copy and assigns to the object. And if you destroy the object material will remain in the memory, you need to reference and dispose of it yourself.
i'm not gonna destroy it, it's gonna be simple project with like 10 of these objects levitating in random directions
and that's all
so, it's still the same
see:
Now make sure you are accessing the correct object
Use Debug.Log("", myObject);
where myObject is the thing you trying to change color to
Then click on the log message and see what it will highlight
make sure it highlights correct object
yes it does
as you can see i'm firstly moving object
and it works well
Set color to Color.red instead
Did you check what numbers your color actually produces?
there you go
Use https://docs.unity3d.com/ScriptReference/Random.ColorHSV.html to generate valid color
I should've checked random function first. Had a headache...