Local Co-op Series (Pt 1: player anim)

Pt 3: Player interaction & gamepad set



Create fire object for player to interact with:


Add Interact in project setting
image.png
Add a new object channel, called Interact, set default response as block
image.png

Open Player Base BP, add Scene component, name as Interact Fire From
roughly put in front of player
image.png
add function, called Interact
image.png
image.png
In event graph, add follow:
image.png
See if it works (the debug showing)
image.png


Test if interact fucntion works:


Back to PlayerBase BP, Interact:
Change back the debug type to none (set for duration is for testing)
Extend the graph:
image.png

Choose an object in scene to interact,
set its collision preset as custom, object type as Interact:
image.png

To communicate with the object:


Create a BP interface, called Interact_BPI
Make function and input:
image.png

Go to PlayerBase BP, remove print string and revise as:
image.png

Create a BP actor, called Base Interactable_BP
add static mesh, add interface
image.png
collison prest on the mesh:
image.png
in event graph
image.png
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.