So for those who have the same question, I've found what needs to be modified:
On the animator Component, there is a drop-down menu named "Update Mode" which has three options:

 - Normal (in-sync with Update method)
 - Animate Physics (in-sync with FixedUpdate method)
 - Unscaled Time (in-sync with Update method, but uses unscaled time)

Use the third one if you have the same problem as me. Also here's a picture from unity's documentation about the animator component:

[![Animator Component][1]][1]

EDIT: I don't know why is this happening but in my case I set `Time.timeScale` to `0.01f` instead of `0` and then everything worked as I excepted

 [1]: https://i.sstatic.net/l25ZP.png