Hi @JOHNSON.M.
Foreign parents of a German child are entitled to a residence permit according to paragraph 28 of the Aufenthaltsgesetz (immigration law). A condition of this is that you have a relationship with the child and are involved in caring for them. Have you and your girlfriend done a declaration of paternity (Vaterschaftsanerkennung) and declaration of shared custody (Sorgerechtserklärung)?
Criminal convictions (i.e. not an ongoing case but once a case is finished and a person is judged guilty of a crime) can have an influence on whether a person is issued with a permit. However, the authorities have to weigh up different factors when deciding whether to issue or not to issue a permit. The fact that you will be a family member of a German citizen weighs very strongly in favour of you receiving a permit. You would have to receive a serious conviction in order for it to play a role in your case.
As regards the comment above, you are not required to leave Germany and apply for a visa for family reunion.
Best,
Éanna