Unreal Engine 4 Tutorial - Online Multiplayer Part 8: Player Scores
Вставка
- Опубліковано 2 лип 2024
- In this series we will be explaining how to add online multiplayer to your games. First we are going to explain how it works, then we will go into creating lobbies etc.
In Part 8 we explain how to use the Player State actor to store each player's score they earn whilst playing in a multiplayer game.
SUPPORT ME
Patreon I / ryanlaley
Buy Me a Coffee I buymeacoffee.com/RyanLaley
Donations I paypal.me/ryanlaley
PRIVATE 1-2-1 SESSIONS
Email me at support@ryanlaley.com for more information and rates, or visit www.ryanlaley.com/learn-games-...
JOIN THE COMMUNITY
Discord I / discord
FOLLOW ME
Twitter I / ryanlaley
Facebook I / ryanlaleygames
Instagram I / ryanlaleygames
Thank you Ryan, this series gave me the basic knowledge I needed to get started on ue4 online multiplayer.
definitely the best explained series on the topic on yt.
Great tutorials! Please keep it going, you have helped me ALOT! :)
Thx bro
Hello, I am more interested in multiplayer video games with dedicated servers, do you have this same tutorial but for that type of server? a greeting!
How do you make it so when you push Tab it only shows on the player pressing Tab vs. everyone seeing it?
Why the scoreBP is deleted in all the scene when we havn't set up replicate option check
Hi I have problem I am watching your turtorials and learning this stuff becasue I am making a multiplayer game I tried to add cube on map and i can move with it by Actor but everyone of joined players have own cube and dont see other cube just cube of that client joined but interesting is that I can move with cubes of other clients but they are invisible for me.... I dont know what to do with it I selected on cube replicate and also load on client then server relevancy and nothing helped
If I was to travel to another level will the score carry over?
👍👍👍👍👍
when will we be doing lobbies
Yo i was so confused, the order of the videos is flipped in the playlist
Will you continue this series, such as Creating Lobbies like in the description?
Yes we will be
@@RyanLaley Yep thats the part nobody else does, am excited to see that
hey ryan,
i'm making a full scoreboard for my fps game, i can reach game state but i cant reach player states. i tried to run code on server by client but it failed again, what should i do?
Why don't you use the built-in PlayerState->Score?
So if i where to use 20 different actors, how would i peform the kasting
Please help the cast to my custom player state is always failing :( i have no clue what to do i did 100% the same as what yo udid
same happening to me
Same thing happening here. It will print if I choose "cast failed" and bring to print string, but wont update score. Nothing happens when I press tab on either client or server if I go through exec from cast to player state. Playerstate is set in game mode, cant really figure out why it fails to cast.
@@TheWufstyle Are you following the tutorial in UE5? Because if so there is an engine error in the Game State that shows as null all the player state. The solution is to create a C++ class inherited from Game State Base, add this in the .h class YOUR_API AClassNameGameState : public AGameStateBase
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, Category = Lobby)
void GetPlayers(TArray& Players);
};
and this in the .cpp
void ALobbyGameState::GetPlayers(TArray& Players)
{
for (auto PlayerState : PlayerArray)
Players.Add(PlayerState);
}
Then you use this class as your Game State Base and it works ^^.
@@Hoke_Th Well thanks for providing me an answer. It is UE5 yes. However, I'm a noob at this stuff, I have no clue about C++. Thanks a lot for the answer and solution, but I'm not capable of that work around :D
Anyone still working thru this tutorial, UE5 Preview Version (2/22 release) fixes this issue.
Anyone help me. Casting to custom player state is always failing (doing everything same as given in video)
I couldn't figure out how to get the loop to work. maybe its just something about UE5 where it doesn't work anymore? But you can get the same info by going to the player character just right clicking empty space(not dragging from node) then type get player state and a generic engine-made variable should pop up. it will work with that one then use an interface to pass it back to the controller
Anyone still working thru this tutorial, UE5 Preview Version (2/22 release) fixes this issue.
@@danfleming1766 I tried this tonight on ue5 and am getting this issue
@@kylemcbride4832 I'm really new to all this, so I wish I could be more helpful. When I did this tutorial using 5.0 PreRelease, it did not work. When I downloaded 5.0 Preview and ran the project using that version, it worked. The blueprint node in the CustomPlayerController called CastToCustomPlayerState which would always fail previously began working, and the whole project worked.
Please man keep going for online tutorial nobody explain it
Just Relax Ryam, We just want to know how take damage , change weapons and death and respawn.
Ah and drive vehicles and fighter plane with guns . Thats all please :)
Ryan if i follow you can i able to make something similar to pubg??
something similar you mean battle royale mode? it is very hard to make something like this first of all, it cost a lot of money, also doing stuff step by step from tutorials wont be enough to make something this big
Start small, make a very, very simple game to begin with. You will not be able to make something similar to pubg as your first game or following tutorials. Read Unreal Engines guide to blueprints and learn everything, that is probably the best way to make such a complex game.