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"

Help with Damage Collision(Fighting Game)

I am attempting to make a fighting game, However I am running into an issue with the collisions. I have a basic character with two sphere colliders that are attached to the characters wrists. I want other player characters to take damage when colliding with the sphere (aka the fist) excluding myself. I am having an issue with the collision detecting however. Could someone help with with the logic behind checking for a collision of the character excluding my own character? (self) alt text

OnBeginOverlap was having reverse results, Where when my character hit another character the damage was applied to myself and not the other character.

Here is the basic damage script I have for my guy

alt text

Product Version: UE 4.9
capture.png (271.2 kB)
capture1.png (69.1 kB)
more ▼

asked Oct 19 '15 at 11:34 PM in Blueprint Scripting

avatar image

Samuel Heinicke
3 1 3 3

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

1 answer: sort voted first

You need to apply the damage to the actor overlapped (it has a pin on the begin overlap node)

more ▼

answered Oct 20 '15 at 12:22 PM

avatar image

2k 62 24 111

avatar image Samuel Heinicke Oct 20 '15 at 02:52 PM

alt text

Thank you for the reply! I have made this script, which is being called in a method called "Punching" this method executes on server. It is doing the job just fine, however BOTH my players are hurt... How can I ignore the player who is punching and only hurt the player getting punched?

capture.png (135.2 kB)
avatar image Matthew J Oct 20 '15 at 09:54 PM

Hello Athin,

The reason both of your characters are currently taking damage would be due to how you're using the GetOverlappingActors node. When it goes to overlap, the spheres are most likely also picking up the character that is dealing the damage. The easiest way to deal with this in your current setup would be to add a branch between the ForEachLoop and Apply Damage nodes that checks to see if the Array Element != (Does not equal) Self with the True of the branch connecting to the Apply Damage node. With this setup, it should cause the branch to fail when trying to apply damage to the damage dealer.

avatar image Samuel Heinicke Oct 20 '15 at 11:28 PM

Thank you so much! That has solved my issue! Knew it was something simple I was doing wrong.

(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