x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Multiplayer Damage

Hi, im making a multiplayer shooter and i nee help with the damage and health system, i have a projectile from the gun hitting the player causing damage but only on the server not on the client, i have replicated the events but i cant damage things with the client. please help.alt textalt text

Health system how the projectile causes damage Shooting bp alt text

Product Version: UE 4.9
Tags:
health.png (307.7 kB)
damage system.png (325.0 kB)
shooting.png (376.6 kB)
more ▼

asked Nov 19 '15 at 10:52 PM in Blueprint Scripting

avatar image

Potat0Sa1ad
3 2 5 4

avatar image Potat0Sa1ad Nov 19 '15 at 10:55 PM

I have watched the unreal networking tutorials but like he said i wasnt thinking about multiplayer until i had finished the charactes bp, so now im not sure how to edit to be able to do multiplayer

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

To fix your problem, all you need to do is click on the damage variable, and set it to replicated. You said you have the events being replicated, but I assume you didn't set the variables to replicated.

Also, you dont need to call the shooting event in multicast, but rather on the server. Just make sure your projectile is set as replicated.

more ▼

answered Nov 20 '15 at 03:10 AM

avatar image

NightHawk45
135 12 8 21

avatar image Potat0Sa1ad Nov 20 '15 at 09:58 AM

Hi sorry, what variable because i dont see a damage variable, i have changed the health to replicated and all the others you said but it doesnt work

avatar image NightHawk45 Nov 20 '15 at 07:54 PM

Is your project using a dedicated server? If not, Im not really sure how to do this efficiently. If you want to use a dedicated server, you can go into your play options and check use dedicated server, and this should work.

avatar image Potat0Sa1ad Nov 20 '15 at 08:38 PM

im running dedicated server, thanks for the help, is there any tutorials or other posts to help?

avatar image NightHawk45 Nov 21 '15 at 01:07 AM

I believe I have found your problem. You need to set ALL of your variables to replicated. You also need to call the changes on the server. For example, make a custom event replicated to server, which sets your "NeedReload" variable to the output. Then where you were setting NeedReload before, call the function, and check whether it should be true or false as an input. Sorry if that is confusing... Here is an example. If this doesn't work, Ill find you a tutorial.

alt text

screenshot (22).png (325.5 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

My own version (damage variable is set to replicated)

https://answers.unrealengine.com/questions/331277/take-damage-multiplayer.html

more ▼

answered Nov 25 '15 at 02:54 PM

avatar image

thyshimrod
399 22 11 39

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question