Skip to main content

Interaction with the multi page turn actor

Create a Third Person Template Project

 

Add Old Animated Books to your Project

 

  1. Start the Epic Games Launcher
  2. Select Unreal Engine
  3. Select Library
  4. Select Add to Project
  5. Select your newly created project

 

Modify the "BP_MultipageTurnActor"

 

You may also duplicate the actor instead of modifying it, but this will require also to duplicate the AnimBluePrint and adjusting all the casts and references. For simplicity we will modify the existing actor:

  1. Open the MultipageturnActor



  2. Remove the auto page turning logic:



  3. Add the following Nodes:



    Add Two Custom Events
    • TurnForwardPublic for accessing the turn forward logic outside (with our third person character)
    • TurnBackPublic for accessing the turn back loogic from outside (with our third person character)

  4. Add a camera to the view port of the actor and name it "camera"



    Place the camera as follows:



  5. Add a Box Collision to the Viewport



    Place the Box collision as follows:



  6. Save and Compile

Modify the Third Person Character

 

 

  1. Add a Box Component to the Third Person Character:

  2. Place the Box like this:

  3. Add Overlapping Events


    One for Begin Overlap



    One for End Overlap

  4. Create the following overlap logic



  5. We will start Interaction with the book by pressing "E", then we will listen to the inputs of "Z" and "X" to Control the page turning once we are interacting with the book 

    For the E Key create the following Logic:

    This will handle the interaction and switches the camera when interacting.

    For the Z and X Key create the following logic:


  6. Compile and Save

 

Place the Book and Play Test

Place the BP_MultipageTurnActor something like this and hit Play

 

Result: