Toddler acting out

Devon

I have a 2 year old daughter and she has always been so well behaved! Since I found out I’m pregnant she’s been hitting me and scratching me on purpose, both hubby and I discipline her as do her grandparents when they see this happen. She doesn’t seem to care, she has her good moments but the majority of the time she’s being mean to me! Did this happen to anyone? When did it get better and what did you do!?