Skip to main content

Interaction with the multi page turn actor

Create a Third Person Template Project

image.png

 

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

image.png

 

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

    image.png



  2. Remove the auto page turning logic:

    image.png



  3. Add the following Nodes:

    image.png



    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 outside (with our third person character)

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

    image.png



    Place the camera as follows:

    image.png



  5. Add a Box Collision to the Viewport

    image.png



    Place the Box collision as follows:

    image.png



  6. Save and Compile

Modify the Third Person Character

 

image.png

 

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

    image.png


  2. Place the Box like this:

    image.png


  3. Add Overlapping Events

    image.png



    One for Begin Overlap

    image.png



    One for End Overlap

  4. Create the following overlap logic

    image.png



  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 book 

    For the E Key create the following Logic:

    image.png


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

    For the Z and X Key create the following logic:
    image.png

  6. Compile and Save

 

Place the Book and Play Test

Place the BP_MultipageTurnActor something like this and hit Play

image.png

 

Result: