Change color of child object

i have a prefab called evil with a script attached to it, in the script i want to be able to change the color of one of the child objects within evil called “Body”, how do i change the material of a child object? im using javascript

The easiest way is to have a reference of Body in the script via editor. Then access the material’s color with this code:

body.renderer.material.color

PS. Finding a gameobject in the scene can be expensive, so I suggest you just get the reference at the start via editor.