If I die, does my ex automatically get my daughter

If I make out a will specifying that my six-year-old daughter goes to my sister if I were to die, would it be honored? My ex-husband gave me sole and total custody with no exceptions at all. Would he automatically get her even if I say differently in a will? What say would she have?