Play Animation Montage In Code(No Blueprints wanted)

I’m trying to play AnimMontage in code.

I Got this in a ACharacter class


void AActorHumanoid::PlayAnimation(UAnimMontage* AnimMontage)
{
	if (AnimCurrent != AnimMontage)
	{
		AnimCurrent = AnimMontage;
		//GetMesh()->PlayAnimation(AnimMontage, true);
		GetMesh()->GetAnimInstance()->Montage_Play(AnimCurrent);
	}
}

The commented line works but not the Montage_Play. There is no transition between my animations and I was thinking of using Montages. I’m new to Unreal and just came from Unity so I’m not really sure what i’m doing.