I have a script that instantiates a prefab. The user can move the mouse over a colour palette and change the colour of part of the prefab that has been instantiated.
How do I access part of the prefab? The model is a car - and I want the user just to be able to change the colour of the body - not the wheels etc
I have a game object with a script component attached.
From this script a prefab is instantiated - a car. I have targeted the prefab in the script with:
var colcar : Transform
It gets instantiated as
ColourCar (prefab)
BR (wheel mesh)
BL (wheel mesh)
FR (wheel mesh)
FL (wheel mesh)
Body (body mesh)
would I use?:
colcar.Transform.Find(“Body”).renderer.material.color = col