characterPos = new float[transform.childCount]; error code example
Example: unity get number of child objects
// The number of child objects is given by:
GameObject.transform.childCount;
// The number of child objects is given by:
GameObject.transform.childCount;