My only advice can be get it checked out ,if she cannot walk its got to be something wrong if she had dislocated it there would be pain, , at 2 year old they dont make this kind of thing up. Good luck ,let us know how she is doing,
Has she been playing games with an older child or babysitter who may have pulled on her leg?
Please take her to see her Pediatrician today. 2 yrs olds are so very active and you may not have seen an accident. My 2 yr old neice skidden on a magazine on the floor~never falling and went on her way. The next day she would not weight bear, but not other crying etc. On the 3rd day they found out she had a broken leg...spiral fracture. It happens and they are too young to point.