Sex addiction & child custody

My ex had a big issue with sex and was seeing women for sexual things... does the court care? I know he’s not right in the head, but I don’t know if the court would take that into consideration or if they see that as an unfit parent.