If you are formally charged with a crime, bail will be set and there is a likelihood that you would be detained until you post bail if the district judge demands a secured bail. If unsecured bail is set, then, you would not be detained during the prosecution. If no charges are pursued against you, then the "investigation" probably will be done by the county child services. Likely that this is not the case as you mentioned the "state". Call an attorney to discuss this as there are significant consequences that could result. Good luck.