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"

Collision damage with sword.

Would it make sense to create a Sword blueprint and make it damage on collision? Or how do people create things like this?

Product Version: UE 4.15
Tags:
more ▼

asked May 06 '17 at 12:12 PM in Blueprint Scripting

avatar image

DamianToczek
26 9 12 12

avatar image ryanjon2040 May 06 '17 at 12:16 PM

Recently I made a Sword blueprint and created a box component to check overlaps and if it overlaps with a Pawn then apply damage to that character. Problem was its not too great especially if it moves too fast or frame rate is low.

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

3 answers: sort voted first

Generally speaking. Adding collision to the sword would fine. However most people would say to add a collision sphere to the Character where you want his "attack range" to be. Then you can do something like event begin overlap, cast to (thing you wanna hit), as (thing you wanna hit) promote to variable "MeleeTarget".

Then on a separate event. Custom event "Swing sword" get MeleeTarget> is valid Bool+Branch= true apply damage.

Hope this helps.

more ▼

answered May 06 '17 at 02:52 PM

avatar image

Cross1013
31 1 3

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

Sorry for the late response, but I noticed that no answer was checked when I came by this question. This is how mine is set up.

Sword Collision



In the BP, I just put on Begin Overlap (that way it only does it on the first overlap and doesn't just sit there hurting the person just touching it, otherwise you can do a Gate Setup that loops itself until OnStopOverlap. Connect the first node of Sequence to the Open node of the Gate, the connect the second node of Sequence to the Enter node of the Gate. Then connect a second Sequence to the exit of the gate. For the first pin, connect it to your damage script, then the second pin of the Sequence to a delay node (so you don't freeze the game applying too much damage, also this is where you can decide your delay between attacks if you want). Connect this delay exit pin to the Enter of the Gate. Then, just connect the OnStopOverlap to Exit on the Gate.

Blueprint for Attack Once Sword Collision BP for one Hit



Blueprint for Attack Continuous Collision Attack Continuous

more ▼

answered Mar 27 '18 at 10:59 PM

avatar image

BubbaBonkers
128 4 6 9

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

This is all so helpful!

What about swords colliding with other swords and creating a bit of a "bounce effect' ?

more ▼

answered Jan 19 '19 at 05:18 PM

avatar image

Kiwikah Inc
18 4 11 11

(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