How to add Paper2D to a 4.17 C++ project?

Hi! I’m porting my game from Unity to UE4. It’s been a difficult but so far enjoyable ride. I’m trying to add Paper2D to my project but cannot seem to be able to do that nor find documentation that shows how to do it. I’ve added the module as a dependency to the build rules (by added the string “Paper2D” to ExtraModuleNames) but I wonder what path should I use for the header files. The API docs don’t show the header files required for, for example “UPaperFlipbookComponent”. Any ideas? Thanks!

1 Like

Ok here’s what I did. I created a new C++ project based on the 2D side scrolling template and I started comparing what was different. You basically have to do 2 things:

  1. Add “Paper2D” to the list of dependencies in the file .Build.cs
  2. You’ll have to add some include search paths to Visual Studio for the Paper2D files to be found:
    A. Right-click your project in Visual Studio (Not the Engine), then choose Properties
    B: Then open the dropdown related to “Include Search Path” and choose “Edit”
    C: Add the 4 following entries:

<Epic Games Folder>\<Engine Version>\Engine\Plugins\2D\Paper2D\Source\Paper2D

<Epic Games Folder>\<Engine Version>\Engine\Plugins\2D\Paper2D\Source\Paper2D\Public

<Epic Games Folder>\<Engine Version>\Engine\Plugins\2D\Paper2D\Source\Paper2D\Classes

<Epic Games Folder>\<Engine Version>\Engine\Plugins\2D\Paper2D\Intermediate\Build\Win64\UE4Editor\Inc\Paper2D

I believe the last one might change depending on the OS you’re running the editor on. My advice is to create a new C++ project based on the 2D side scrolling template and take settings from there.

Hope this helps!

1 Like

Please also check this question: https://answers.unrealengine.com/questions/150461/paper-2d-c-cannot-open-source-papercharactergenera.html

1 Like