#yes im creating it with script and then

1 messages · Page 1 of 1 (latest)

hidden iris
#

I'm not seeing those properties on any default materials.

#

Create a default material with default shader from scratch and test on that

stable temple
#

done

hidden iris
#

now just set color through Material.color

stable temple
#

okay

#

this is entire script

#

should be okay?

hidden iris
#

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.

stable temple
#

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:

hidden iris
#

Now make sure you are accessing the correct object

stable temple
hidden iris
#

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

stable temple
#

as you can see i'm firstly moving object

#

and it works well

hidden iris
#

Set color to Color.red instead

stable temple
#

hmmm

#

okay

hidden iris
#

Did you check what numbers your color actually produces?

stable temple
#

it worked

hidden iris
#

there you go

stable temple
#

thanks man!

#

i couldn't manage it out without you

hidden iris
#

I should've checked random function first. Had a headache...