# Handle Sequencer Events in C++ code

**URL:** <https://forums.unrealengine.com/t/handle-sequencer-events-in-c-code/78562>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [November 17, 2016, 12:52pm UTC](https://forums.unrealengine.com/t/handle-sequencer-events-in-c-code/78562 "2016-11-17T12:52:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdeni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mdeni](https://forums.unrealengine.com/u/mdeni)\
**Post date:** [November 17, 2016, 12:52pm UTC](https://forums.unrealengine.com/t/handle-sequencer-events-in-c-code/78562/1 "2016-11-17T12:52:55Z")

</div>

Hi all!

Is it possible to handle events from Level Sequence in C++ code? I have found this article:

> **[Calling Events through Sequencer](https://docs.unrealengine.com/4.26/en-US/AnimatingObjects/Sequencer/HowTo/TracksEvent/)**
>
> Example of how you can use Sequencer's Event Track to fire off Events in Blueprint.

But it’s only for blueprints ☹

Hope for your help.

BTW One more question 🙂 Is it possible to loop one Shot in Level Sequence? Can’t find this feature…

---

<div class="post-metadata">

**Author:** ![mdeni](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mdeni](https://forums.unrealengine.com/u/mdeni)\
**Post date:** [November 21, 2016, 2:32pm UTC](https://forums.unrealengine.com/t/handle-sequencer-events-in-c-code/78562/2 "2016-11-21T14:32:12Z")

</div>

Okey, I found the solution. The main idea in this article “Solus C++ Tutorial: Creating Custom Level Blueprints in C++”:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

First of all create own LevelScriptActor based on ALevelScriptActor. And realize in its all necessary events. For example:

```php

UCLASS()
class SOMEGAME_API ADefaultLevelScriptActor : public ALevelScriptActor
{
    GENERATED_BODY()
	
public:	
	
    UFUNCTION(BlueprintCallable, Category = "Level Sequence")
    void OnFadeFinished() { /* Some code here */ }
};

```

Then reparent Level Blueprint to our class. And add event called “OnFadeFinished” to our Level Sequence.

That is all and all works fine :o

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b2e0c5cd](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b2e0c5cd](https://forums.unrealengine.com/u/anonymous_user_b2e0c5cd)\
**Post date:** [May 26, 2020, 6:14pm UTC](https://forums.unrealengine.com/t/handle-sequencer-events-in-c-code/78562/3 "2020-05-26T18:14:26Z")

</div>

Its already been a while but i think this is important as i did my fair share of digging too and this popped up a lot of times.

The problem with your event only firing when it doesnt hold any parameters comes from the fact that Unreal doesnt pass the struct holding the variables to the event but each variable separately.  
So in case your struct holds a string and an integer the target blueprint event has to have separate inputs for each of those and not only one for the complete struct.

This is also mentioned in this post: [Sequencer: Is it possible to pass struct as parameter to custom events? - Cinematics & Media - Epic Developer Community Forums](https://answers.unrealengine.com/questions/573370/view.html)

Further more in the following forum post is described how to create custom event structs and how to add them to a track in c++: [https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1553991-solved-create-sequencer-events-from-c-in-4-20](https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1553991-solved-create-sequencer-events-from-c-in-4-20)
