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"

Problem with damage from clients

Hello there, lately I have been working on my first unreal engine game. But now I have a problem, I have a damage system set up that works perfectly on single player, but if I try to run it on a server with 1 extra client, the client can't deal damage. It probally has to do with authority but I dont know how to fix it, please help me.

Here is my damage system: alt text alt text

And one important thing, I want to do as much as possible in blueprints.

Thanks everyone!

  • Erik

Product Version: UE 4.12
Tags:
apply damage.png (247.3 kB)
more ▼

asked Jun 10 '16 at 08:18 PM in Blueprint Scripting

avatar image

erik321123
408 17 15 31

avatar image erik321123 Jun 11 '16 at 03:33 PM

Any one pls

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

1 answer: sort voted first

Hey, first you have to create a custom event on the object that will be dealing the damage, and set it to run on server. when that event triggers, have it deal the damage. finally, if you have a health variable anywhere, that is set from the damage, check that it is set to replicate, so the client will see their health go down.

edit: I can see that you have health replicating, so you just need to make sure the server is the one calling the event that causes damage.

more ▼

answered Jun 11 '16 at 05:01 PM

avatar image

IcemanX
133 4 6 10

avatar image erik321123 Jun 11 '16 at 05:51 PM

Thanks for your answer this is what I have right now, but it doesn't seem to really work.

alt text

newapplydamage.png (259.6 kB)
avatar image erik321123 Jun 11 '16 at 05:56 PM

EDIT: I also tried to reliable replicate to server and that also doesn't work. Am I missing something obvious? This btw is in the projectile class. And the damage dealing in the character base class is still the same. ()2nd picture in the question)

avatar image IcemanX Jun 11 '16 at 06:00 PM

Oh, I see. it's probably the projectile. if the client is the owner, then it would run the server event to deal damage. whoever/whatever calls the event has to own the projectile. make sure that either the bullet is created on the server so that this triggers on the server, or that the client owns the bullet,so it will still call to the server.

I think it works on the server because it's the owner of the bullet, but it doesn't work for the client because for some reason it's not the owner of the projectile.

avatar image erik321123 Jun 11 '16 at 06:09 PM

Thank you so much! I now spawn the projectile from an event that is replicated to the server and it works.

avatar image IcemanX Jun 11 '16 at 06:25 PM

you're welcome! I had the exact same problem a few months ago. :P

(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