Alright, i’m pretty new to UE4 and i’m working on my first game (which is online). Pretty clunky but it works well so far. The project as it stands right now is just a 3rd person shooter, so my goal at the moment is simply putting 2 characters on the map and letting them kill each other. So far, i have all the movement animations, the gun mechanics, etc. i have a line trace so when you fire, there will be an explosion where the trace hits a part of the map (just so you know it actually works). It took a while, but i managed to figure out the replication for it so that the server and all the clients can see all the animations. I know that i probably just need to add something where if the line trace overlaps a player, it will take away some of their health.
So the part i’m stuck on is health and damage. I’m not sure how similar health and damage works in comparison to a singleplayer game. I tried looking at the ShooterGame example but i had no luck, for some reason i can barely find any actual blueprint scripting at all in that game which is really weird.
Anyways i’m getting off topic. Does anyone have an example i can study of players having health and taking damage due to gun shots? I’ve searched the internet for the past couple hours and haven’t come up with anything. Any help at all would be great.
UE4 got damge system, with take damage function as well us event for it
Based on that you simply operate health varable (that you need to make, because UE4 don’t want to impose health system on you), on damage you also check if health goes down to or below 0, if it does you kill player. Now with multiplayer, you simply need to make it so code runs primerly on server and client only get health data. This is pretty much valid to everything that you don’t want to be hackble, Remember that user can access and modify it own computer’s memory so any data from clientis not trustworthy by default, server is the one who needs to be a game master and jurge of the game
Hm… i should add that i’m only using blueprints for now (im taking a programming class next semester in college so ill probably start doing c++ coding once i start that class), should i be able to accomplish everything with blueprints and such?