Timeline in C++ triggers breakpoint

I have been following these two links to try and get Timelines to work in C++:

I tried both UTimelineComponent and FTimeline but both ways are triggering a break point when I try to play. Here is a screen shot of the error:

Edit: I tried initializing the timeline and curve in both the BeginPlay function and the constructor but to the same results.

Hey there, you need to see what is the actual cause of the crash, check the Autos tab to see if anything is invalid (especially check the this variable, myDoorRotateComponent and myResetRotationTimeline).

Usually crashes like this are from accessing an invalid object, just confirm that that is the case to know how to proceed.

Can you tell which exception is being thrown?

Why would it be invalid? I followed the previous tutorials and none of them mentioned this issue. Should I be initializing it by calling initialize component? Because that did not work either :frowning:

All I’m getting is what you see with the triggered break point. I tried it again with UTimelineComponent and here is where it triggered a breakpoint: https://i.imgur.com/NjWCLL6.png

Doesn’t look like an exception per-say, just triggers break point.

Ok so it seems your timeline is set to null. To confirm you can comment the PlayFromStart command and see if it doesnt crash. If that doesn’t crash then it confirms that the problem is indeed in the timeline. When you defined the timeline did you set it to UPROPERTY()?

Just tried to set it to UPROPERTY() but I don’t think it helped, I still got a triggered breakpoint in the create default sub object. Here is a screen shot:

Can you show me where you initialize the timeline?

Sure, Here is where I am initializing the curve and the timeline. Its in BeginPlay() :

Does the AddInterpFloat code executes? That would mean that the timeline is still valid in the constructor.

If I use UTimelineComponent pointer, ue4 triggers a breakpoint on line 59 when I try to CreateDefaultSubobject. If I change it to use FTimeline object, it compiles and runs without error, the issue I see now is that the object is not calling the update function I provided (ResetRotationTimelineUpdateCallback).

When you say triggers breakpoint on line 59, you mean crash?

I mean what you see in the first image.