SideScrollerTemplateを参考に、CharacterMovementComponentの Planar Movement > Constrain to Plain をONにしてください
Planar Movement > Constrain to Plain