How Get Current Time for AnimMontage?

hello, i need your help because i know nothing about c++. (i just want to get the current time of anim montage)
Last time i searched a soluce for get “current time” for my anim montage and i found this :

[https://answers.unrealengine.com/questions/78014/animblueprint-montage-get-current-time.html][1]

So i followed, (i tried to understand but i can’t, so i just copy paste and that doesn’t work)
I’ll illustrat what i did with 2 pictures.

Thx for any help (sorry for bad english).

Hello,

You should not Change the Character.cpp itself, you should create a custom character class derived from ACharacter (Character.h)

Inside your custom character (let’s call it MyCharacter) You can do something like this in any function where you want to get the position:

    if(!GetMesh())
    {
        return;
    }

    UMyAnimInstace* AnimInst = Cast<UMyAnimInstance>(GetMesh()->GetAnimInstance());
    if (AnimInst != NULL)
    {
        float Position = AnimInst->Montage_GetPosition(MyMontage);
    }

~ Dennis Andersson

Hello, thx for your help, but that doesn’t work, i think i know why but how do ?
i’ll try to find a good c++ tutorial for learn c++ and i’ll see if that work.