Python code with Unity

Hi there,

I’m trying to use python with Unity, the setup is fine and I was able to execute some script on Unity, but actually i’m trying to execute a simple code, that will look for a GameObject and assign to its child a color

import UnityEngine as ue

go = ue.GameObject.FindGameObjectWithTag("CubesManager")
if go:
    meshRenders = go.GetComponentsInChildren<ue.Renderer>()
    #if len(meshRenders) > 0:
    #    for ren in meshRenders:
    #        ren.material.color = ue.Color(1, 0, 0)

But i keep receiving the following error PythonException: TypeError : ‘bool’ object is not iterable
Does anyone know how to solve this issue ? Is python not recognizing that the function return a list/tuple ?
I tried also the following line but same thing

    meshRenders = go.GetComponentsInChildren<ue.Renderer>()

Any help would be appreciated

Thanks

For those who will be facing this kind of issue in the future, Python doesn’t seem to recognise the template function call, so instead i used the simple one. Here’s how the code loook like

import UnityEngine as ue
import random as ran

go = ue.GameObject.FindGameObjectWithTag("CubesManager")
if go:
    meshRenders = go.GetComponentsInChildren(ue.Renderer)
    if meshRenders:
       for ren in meshRenders:
           r = ran.random() 
           g = ran.random()
           b = ran.random() 
           ren.material.color = ue.Color(r,g,b)