Creating network-aware pawns for multiplayer
Now that we've seen a bit about how information moves from the server to the clients, let's explore the ways player actions get communicated from the clients back to the server. To get ready for this, we're going to take a shortcut and add a pawn that can already perform a few basic actions, and we'll get right to the task of making these actions work in a multiplayer setting.
Adding a first-person pawn
We're going to set ourselves up by adding the pawn from the First Person
template:
- Create or open a project made using the
Blueprint
|First Person
template. - Select
Content
|FirstPersonBP
|Blueprints
|FirstPersonCharacter
, and migrate this character into our working project.
Now, we need to tell our game mode to use it.
- Open
BP_MultiplayerGameMode
, and set itsDefault Pawn Class
to theFirstPersonCharacter
we just migrated in.
Let's test it. We should see a number of problems here. Our projectiles are bouncing off invisible walls. When players fire...