# Unreal engine how to put play to a level sequencer from C++ "get an ALevelSequenceActor from the scene in c++"

**URL:** <https://forums.unrealengine.com/t/unreal-engine-how-to-put-play-to-a-level-sequencer-from-c-get-an-alevelsequenceactor-from-the-scene-in-c/502492>\
**Category:** C++\
**Tags:** unreal-engine, CPP, UE4-27, question\
**Created:** [February 27, 2022, 3:08am UTC](https://forums.unrealengine.com/t/unreal-engine-how-to-put-play-to-a-level-sequencer-from-c-get-an-alevelsequenceactor-from-the-scene-in-c/502492 "2022-02-27T03:08:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ariel\_Gimenez](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ariel_gimenez/32/591990_2.png) [@Ariel\_Gimenez](https://forums.unrealengine.com/u/Ariel_Gimenez)\
**Post date:** [February 27, 2022, 3:08am UTC](https://forums.unrealengine.com/t/unreal-engine-how-to-put-play-to-a-level-sequencer-from-c-get-an-alevelsequenceactor-from-the-scene-in-c/502492/1 "2022-02-27T03:08:40Z")

</div>

Unreal Engine Version: 4.27.2-18319896+++UE4+Release-4.27

 ![Screenshot_6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/9/0/090011f910d8ccf36efee452a1785bf394814c87.jpeg)

Does anyone know how to include ALevelSequenceActor in a .CPP file, I did not enter the form, it shows me an error…  
The issue is that I want to handle the levelsequence from C++ but I can’t find a way to include the library.  
**I mean I include it like this.**  
 ![Screenshot_5](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/5/e/b5e7d99a6b1a9560ec275e83bae05191b6b678c3.jpeg)  
code:

```auto
#include <LevelSequence/Public/LevelSequenceActor.h>

```

and if i want to do this  
**Error in ALevelSequenceActor::StaticClass().**

 ![Screenshot_12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/6/a/f6af9c0a84223c57041421d61f148cc9c3debd98.jpeg)  
Code:

```auto
|TArray< AActor*> level_Sequences;
||UGameplayStatics::GetAllActorsOfClass(GetWorld(), ALevelSequenceActor::StaticClass(), level_Sequences);

```

I also included in Build.Cs LevelSequenceActor, but it doesn’t work.

 ![Screenshot_11](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/b/8/2b87107ca478cdbb523a345078029f28573344ef.jpeg)

And this is a weird include error that appears in LevelSequenceActor.h

 ![Screenshot_7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/5/6/1560d069076f9735186e46178ce937704d2e63e1.jpeg)

I also cannot declare a pointer of type ALevelSequenceActor

 ![Screenshot_9](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/f/a/afacbe174cbf0d15b87e400192d7bafea95e0546.jpeg)

---

<div class="post-metadata">

**Author:** ![Ariel\_Gimenez](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ariel_gimenez/32/591990_2.png) [@Ariel\_Gimenez](https://forums.unrealengine.com/u/Ariel_Gimenez)\
**Post date:** [March 1, 2022, 6:25pm UTC](https://forums.unrealengine.com/t/unreal-engine-how-to-put-play-to-a-level-sequencer-from-c-get-an-alevelsequenceactor-from-the-scene-in-c/502492/2 "2022-03-01T18:25:50Z")

</div>

Tutorial in Spanish showing the procedure to solve this problem.

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/4/1/34188435249bf508db42ce4fc8c764e36b425385.jpeg "Unreal Engine C++ cómo usar el level sequence y solucionar problemas de compilación") ](https://www.youtube.com/watch?v=8Mk8PvL3YWw)

Things to keep in mind  
in build.cs in PublicDependencyModuleNames.AddRange  
add “LevelSequence”, “MovieScene”

 ![Screenshot_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/9/3/393148f07337223fae848c84509be7710f0f6a1a.jpeg)

declare the variable with forward declaration in the .h file

 ![Screenshot_4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/c/d/9cdcdf63b4a71598f929438f497c76ae6523c677.jpeg)

Include modules with symbols \<\> instead of “”. with this operation you should be able to search for it in the scene and make it work

 ![Screenshot_3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/7/f/d7f15c1df12bab64ca4b9d95f0dabb3f6f38d6d0.jpeg)

When you do that if you have autocomplete problems or the errors mentioned above, delete the content inside the “Binaries” and “Intermediate” folder in your project files. WHAT’S INSIDE, not the folders  
Also delete the .sln

 ![Screenshot_7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/e/8/de87eb2d083d05ed1c818c2447197ebb55cbd3cd.jpeg)

Then regenerate the Visual studio files by right clicking on the unreal icon

 ![Screenshot_8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/f/e/1fe6dc7daa8f03ab3474a9ea228c527a6145f9a3.jpeg)

and ready problem solved!.

Project source code on github in case you want to see it

> **[GitHub - kone9/Unreal\_engine\_levelSequence\_CPP: Example project using...](https://github.com/kone9/Unreal_engine_levelSequence_CPP)**
>
> Example project using levelSequence from C++. Contribute to kone9/Unreal\_engine\_levelSequence\_CPP development by creating an account on GitHub.
