Skip to content

Integrate to your own project

Adriwin edited this page Sep 10, 2024 · 7 revisions

This page is a Work in Progress and hasn't been updated since a lot of commits so it might be a bit outdated. I recommend you to see how it's done in the base project for each steps, and just copy how it's done for the base project in you own. Images are hosted on Imgur

Prerequisites

Knowing the basics of Unreal Engine

I assume that if you're here, you already know at least the basics of this incredible engine. However, just to make it clear, you need to have a basic understanding of Unreal Engine before continuing. If you don't, I recommend checking out the Unreal Sensei channel to learn the basics, particularly this video.

Knowing a bit about Common UI

It would be helpful to have some knowledge of CommonUI before continuing. You can do this by watching this livestream. However, if you are already experienced with UE5, you could probably learn on the go by reading this Wiki and browsing through the project files.

Integration

Setting up CommonUI in your project

  1. Go to Edit>Plugins and search for CommonUI

    Plugins Common UI search

  2. Enable it

    Common UI Plugin

  3. Restart the Engine

    Restart Engine Prompt

  4. Once restarted, go to Edit>Project Settings and search for "Viewport"

    Project Settings, Viewport search

  5. Change the "Game Viewport Client Class" to "CommonGameViewport"

    Change Game Viewport Cilent Class

    to CommonGameViewportClient

  6. You will be prompted to restart the editor, so do it by clicking on "Restart Now"

    Restart Requiered Prompt

Adding the Plugins

  1. You can either add them to your engine plugin folder or to your project folder. More details here
  2. Enable them all in your project before continuing
  3. Close your project

Adding the files to your project

  1. Open the local files of my project by clicking on "Show in Explorer" with GitHub Desktop

    GitHub Desktop show in explorer image

    Local Files Image

  2. Go to \content\ and copy the CommonUI folder

    Copy CommonUI folder image

  3. Go to the \content\ folder of your project and paste it

Your project content Image

Setup your Project Settings for these new files

  1. Open your project again

  2. Go to Project Settings>Game>Common Input System

    Common Input System Settings Image

  3. Change the parameters to be the same as in my project, so as I am writing this:

    1. Set Input Data to "CU_InputData"

      Set Input Data Image

      CU_InputData Image

    2. In Platform Input>Windows>Default>Controller Data, add everything so it looks like this

      Blank Controller Data Settings Image

      Filled Controller Data Settings Image

    3. Enable "Allow Out Of Focus Device Input"

  4. Go to Project Settings>Plugins>Common UI Editor

    Common UI Editor

  5. Again, change the parameters to be the same as in my project, so as I am writing this

    Filled Common UI Editor Settings Image

  6. Go to Project Settings>User Interface

    User Interface Settings Image

  7. Set "Render Focus Rule" to "Never"

    Render Focus Rule Setting Image

  8. Go to Project Settings>Maps & Modes

    Maps & Modes Settings Image

  9. Set Both Maps to "LVL_Frontend"

    Maps & Modes Settings Changed Image

Adapting your code

  1. If you have a custom Player Controller, open it

    Player Controller Image

  2. Add these nodes

    Nodes to add Image

  3. Go to Content\CommonUI\Widgets

    Content\CommonUI\Widgets Image

  4. Open UI_MainMenu

    UI_MainMenu Image

  5. Go to Graph on the top right

    Graph Button Image

  6. Set the "Level" variable to the level you want people to access via the main menu

    Side Panel

    with selected level

    Level set

Adding Inputs

  1. Open your Character Blueprint Character Blueprint Image

  2. Add the inputs you want to open the pause menu with, mine are these

    Pause Inputs Image

  3. Add those nodes and connect them to your Inputs Actions

    Nodes to add Image

  4. You are good to go! Enjoy!

The only little problem is that volumes slider in the "Audio" settings won't work. I will make another tutorial on how to make them work later.