Player Attack Animations over the Network
Author: Adam Stagg
The challenge for this week was to get the player attacks working over the network. I was having some issues with the RPCs not working in the correct way, and I am still unsure why it was not working. I switched from working on my desktop to my laptop, rewrote the exact same code, and it worked. Regardless, it is working now, and the light and heavy attacks are able to be seen across every player.
When the attack is called, it goes to a server RPC, which then calls a multicast RPC. Multicast RPCs will execute on every client and server when called on the server, but only on the client if called by a client. This will ensure that every single client and the server all will get the same call to the attack.
The general structure for this goes:
.h
UFUNCTION(Server)
void ServerFunction();
UFUNCTION(NetMulticast)
void MulticastFunction();
.cpp
void ServerFunction()
{
//Any server specific code
MulticastFunction();
}
void MulticastFunction()
{
//Code to be executed on every player
}
Luddite
Status | Released |
Author | Me Gusta Productions |
Genre | Adventure |
More posts
- CutscenesSep 22, 2022
- Balancing the enemiesSep 22, 2022
- Quest GamefeelSep 12, 2022
- Dungeon SpawnsSep 11, 2022
- Questing SystemsAug 24, 2022
- Adding Physics to our GameAug 19, 2022
- Questing backendAug 16, 2022
- Dungeon Nav MeshAug 09, 2022
- Dungeon CorridorsJul 21, 2022
Leave a comment
Log in with itch.io to leave a comment.