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"

Stop damage to self in multiplayer

Hello, I've set up my blueprints to replicate shooting, damage, etc in multiplayer. The damage/hit detect is determined using Sphere Overlap Actor and Apply Damage functions. This is all in a Projectile blueprint separate from MyCharacter. These features work fine.

However, I don't want my bullets to hurt myself. Everything I've tried has led to one of the players being invincible or both. Sphere Overlap Actors has an Actor to Ignore option, but it doesn't seem to work, since Get Player Character returns a static index, not the actual current character.

How do I go about making my projectile ignore its shooter? Is there a way to know which player character is which, and compare to see if the shooter of a projectile is the same as the one being hit?

Product Version: Not Selected
Tags:
more ▼

asked Apr 26 '15 at 04:46 AM in Blueprint Scripting

avatar image

somelameguy
1 1 1 1

avatar image call95 Oct 28 '15 at 05:17 PM

Hi somelameguy, i'm working on melee combat in my project and have the same problem as you, did you find a solution or a method using blueprints?

avatar image Sublimation Feb 28 '17 at 10:28 PM

Hi did anyone find a solution for this?

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

3 answers: sort voted first

Set in bullet reference to your character, and when bullet damages someone, check if your reference equals damaged character (if true don't make any damage)

more ▼

answered Mar 04 '18 at 09:29 AM

avatar image

SpynderYT
87 3 3 9

avatar image ThompsonN13 Mar 04 '18 at 04:36 PM

this same method as well as some other are shown in this question from a few days ago.

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

hello, you could add a tag to your character and then maybe in the bullet's blueprint, add an ActorAsTag node, if what hits does not have that tag then it can affect health, you can also use it to specify the characters not to hurt in a multiplayeralt text

tag.png (530.0 kB)
more ▼

answered Mar 04 '18 at 07:14 PM

avatar image

stehc88
1 1 2

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

I have a really bad solution, but it works to some degree. Wish someone would present an actual solution to this issue, because I really don't know how to handle figuring out who spawned the projectile because technically it's always the server.

Anyway, here's what I have.

I have my Character Blueprint which Spawns Weapon into the character's hand, and I cast to the weapon to say "Fire" and the Weapon Blueprint spawns a Projectile Blueprint. So basically, Character > Weapon > Projectile.

What I did to prevent from shooting myself, but still being able to deal friendly fire damage, was this:

alt text

This is a really jank solution, but it's all I could come up with.

There are 2 major issues.

  1. A player can still hit themselves if they're moving fast enough or something.

  2. You still won't be able to hit other people if you're all stacked on top of each other or really close to each other.

Happy hunting,

-Metric

more ▼

answered Oct 23 '18 at 11:13 PM

avatar image

MetricZero
69 8 9 12

(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