UMG Animation not working when deriving from C++ UserWidget

I am currently working on a UMG Task in Unreal and have built most of the UMG Classes in C++. Now I wanted to create a UMG Animation to animate the transform scale in and out. I created a Blueprint widget deriving my C++ class and used my custom Events “Show” and “Hide” to trigger an animation I created within that Blueprint.
Now my problem is, the animation wont play. If I modify the transform values directly in defaults panel its working but when I try to get them changed by the animation nothing is working. I already tried passing the animations to the C++ class and play them using C++ but that didn’t work too.
The interesting thing is, I have another C++ deriving Blueprint Widget inside this Widget. When I try to animate the transform within this child, it is working, but not in its parent, although they are both C++ deriving blueprints.

I have added some screenshots to clarify my problem:

This is the C++ deriving User Widget in which the animations do not work.

This is the Child widget that is inside the UserWidget from above. In here the animations are working.

This is how I trigger the animations on the child, and this works, but insead of here i want the animations on the parent.

This is what i want! But this animations do not work.

1 Like

Ok I have found the problem…
I have overwritten the function NativeTick and also called the parents function. But instead of calling Super::NativeTick I accidentally called Super::Tick thus calling the blueprint event two times instead of calling the classes default tick behaviour. I looked inside the source of the Super::NativeTick function and found that it calls the function TickActionsAndAnimation. And since I didn’t call the correct parent function this was never called. (-‸ლ)

So remember: Always check if you really called the parents function if you overwrite a function in C++…

1 Like