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"

Attack and monster damage problem (2D)

I created a simple 2D attack sistem for my character and a basic monster that run and attack the player. The big problem I have is that i dont know how to let the monster take damage only by hitting the "sword" of my character. I didn't find any guide concerning this.

I did something but is completely wrong because the enemy take damage even if it hit me from behind and the character dont get any damage.

This is how I set attack status and animation: alt text

And this how monster take damage (here is the problem...) alt text

How can i create a funtioning monster that take damage only from the character swords?

Product Version: UE 4.7
Tags:
controller.png (353.5 kB)
mob.png (463.9 kB)
more ▼

asked Jul 02 '15 at 08:55 AM in Blueprint Scripting

avatar image

ale929
59 11 21 29

avatar image ale929 Jul 04 '15 at 09:23 AM

Could someone please tell me how to add specific hitbox (hurting one and simple colliding one) for each frame?

avatar image b16redlined Jul 04 '15 at 09:40 AM

When you set the collision in the flipbook itself can you have it being around only the sword or no? Then only take damage when the characters capsule is hit. I'm making a 2d game but I'm not at this point yet.

avatar image b16redlined Jul 04 '15 at 09:52 AM

Or you could add 2 boxs or capsules connected to the character and have it point in both positive X and negative X then an onOverlap if is Attacking is true(with a branch) cause the damage to the monster. Put in a get vector and get velocity so you can have it work to the left or right and not both at once.

Hope that makes sense.

avatar image ale929 Jul 09 '15 at 07:15 AM

The fact is that the attack pattern is not so simple and I would like to move the hitbox with the sword to avoid the monster to be hit before the animation has reached him. That was why i wanted to add a collision box on the sword every frame... but i dont know hot to do it. Something like in this video: https://www.youtube.com/watch?v=Vp1qIUPtETs

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

0 answers: sort voted first
Be the first one to answer this question
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