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"

How do i prevent my character from hitting himself?

I am making a 2D multiplayer game. When i use my sword i sometimes hit myself. How do i make the sword only hit other players?

Product Version: UE 4.14
Tags:
more ▼

asked Dec 30 '16 at 07:39 PM in Blueprint Scripting

avatar image

kenx00x
1 1 2

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

2 answers: sort voted first

I just made it that it is checking if any player is using their sword with a variable. This will also be a blocking system at the same time.

more ▼

answered Dec 31 '16 at 05:58 PM

avatar image

kenx00x
1 1 2

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

What collision method are you using? Some of the collision blueprint nodes have a setting for excluding yourself. If they don't just add a Branch node that checks to see that the object it is hitting is not your character. Then only proceed if that is true.

more ▼

answered Dec 30 '16 at 07:53 PM

avatar image

Dartanlla
2.6k 63 28 281

avatar image kenx00x Dec 30 '16 at 08:11 PM

what blueprint nodes have the setting to exclude myself?

avatar image Dartanlla Dec 30 '16 at 08:38 PM

Line and Sphere trace nodes have an ignore self checkbox. If you are using Begin Overlap just check to make sure the Other Actor pin isn't yourself.

avatar image kenx00x Dec 30 '16 at 09:22 PM

I am using OnComponentHit. but when i use my sword sometimes it collides with me. I want it to check that i am the one that used it but i dont know how. The line and sphere trace nodes aren.t helpful to me with my current blueprints and begin overlap is also not useful for the same reason.

(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