- Home /
Parent component affect child objects
i want to make a single component of a null affect its children however im stuck for ideas on how i would even start.
for example - my null is called past and it has a mesh render component, inside the past null is a cube, is there a way to use the past mesh render component to affect the mesh render component on the cube?
EDIT - yes by null i mean empty game object (to used to c4d terms), and the property im trying to use for the children is Mesh Renderer and Collision tags
I don't understand your question. By null are you talking an an empty game object? And what specific property are you trying to change from the parent?
The mesh renderers do not have a direct parent-child relationship. The parent-child relationship is between the game objects that have them.
If you want to get the mesh renderer for the child you should look at the GetComponentInChildren function. $$anonymous$$eep in $$anonymous$$d that function will only give you the first component it finds, and that may not always be the same one if you have many children with the same component type.
Once you get a hold of the renderer that way, just pass the values in from your parent renderer.