Interaction with the multi page turn actor
Create a Third Person Template Project
Add Old Animated Books to your Project
- Start the Epic Games Launcher
- Select Unreal Engine
- Select Library
- Select Add to Project
- 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:
- Open the MultipageturnActor
- Remove the auto page turning logic:
- 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)
- Add a camera to the view port of the actor and name it "camera"
Place the camera as follows: - Add a Box Collision to the Viewport
Place the Box collision as follows: - Save and Compile
Modify the Third Person Character
- Add a Box Component to the Third Person Character:
- Place the Box like this:
- Add Overlapping Events
One for Begin Overlap
One for End Overlap - Create the following overlap logic
- 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: - Compile and Save
Place the Book and Play Test
Place the BP_MultipageTurnActor something like this and hit Play
Result: