RootMotion not work when set AnimInstanceClass in runtime

I`ve noticed that set AnimBP in Blueprint, RootMotion work fine. But when I set AnimInstanceClass in run time by c++. RootMotion not work.