Croatia is an E.U. country, but it is not in the Schengen Zone. I would not be working in Hungary. If I need to leave the E.U., how long do I need to be away for?
You need to explain your current situation better. What country are you a citizen of? How did you arrive in Croatia?..
Hungary is very hostile to migrants.