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

Pt 2: Anim tweaks and split screen



Get the mulitplayerP:


Open Playerbase BP, add variable:
image.png

Create 2 child parent base BP, called Player 1 and 2 BP
Open player 2, set play index to 1 (player 1 is 0)
image.png

Go to 3rd person game mode BP, change default pawn class to player 1:
image.png

To spawn the Player 2:

Change the mesh of player 2 to mannequin
In 3rd person gamemode BP, make custom event
image.png

Open Level BP in current map (3rd person Map):
image.png

Now split horziontal screen in game mode once pressing P

To change to vertical/grid split, go to project setting:
image.png

tick Skip assiging gamepad to player 1 (to let gamepad controller player 2, or else both keyboard and gamepad just control player 1)

Back to PlayerBsae BP, add custom events
image.png

In 3rdperson Game mode BP, add follow nodes:
image.png


To set only 2 number of splitted screen, by using destroy player:

(now can add up to 4 if pressing P 4 times. Aim to hit P is only swift between 1 and 2 players)
image.png

In 3rd person game mode, add custom event:
image.png
In 3rd person Map (if want to change back to up to 4 players by hitting P, connect P node directly to bottom Cast to BP thirdperson game mode node, skip the branch:
image.png
In PlayerBase BP:
image.png


Optional: If player 1 and 2 start in the position to close to each other:


In player base BP, both Mesh, and capsule components:
Collison preset: Custom, tick ignore Camera
image.png


To fix character jumping anim:

Go to the character ABP:
Add follow from sequence 1 (promote variable boolean from Is Falling node)
image.png
In Case state graph, drag fall loop anim in graph and connect as:
image.png

P.S the Manny anim not work on my character, so I import the falling idle anim,
and tick force root lock in Root motion, if the anim imported not in a correction rotation:
image.png
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.