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 counter attacks from my AI?

So I am working on a melee system for a project, I am fairly new to the engine. I cannot figure out how to counter an incoming attack from the enemy. Like a parry system in God Of War games. I know it has something to do with collision boxes, but I just dont know where to start as I don't have any idea how collision boxes work. I know how trigger box works though. I would really appreciate any help.

Product Version: UE 4.11
Tags:
more ▼

asked Aug 27 '16 at 02:10 PM in Blueprint Scripting

avatar image

Fl4MES
9 4 7 10

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

1 answer: sort voted first

Hi there,

A collision box works quite exactly the same way like trigger boxes I believe. However for your melee system you probably will have to learn a bit more if you don't know how to do it (would have to look into it myself as well)..

First you need to learn a lot more about blueprint scripting because that's what you need to do, you need to write a script that knows what attacks are being projected towards your player, then you need to make a system that while the enemy attacks there's a time frame within which you can press a key in order to parry the attack. For all of this you need to know how you can get information back and forth between your animation blueprint (where the animation logic for your attacks and such is stored) into your melee system blueprint where you create all the logic of the actual combat.. that's at least how I would go about it.

What you want to do is not simple, usually there are big teams creating these thing but if you are patient and persistent you can succeed as well, here are some links that give you an introduction to the things you need to know:

Hope this helps and good luck,
Gull Jemon Studios

more ▼

answered Aug 27 '16 at 02:19 PM

avatar image

GullJemonStudios
133 31 30 34

avatar image Fl4MES Aug 27 '16 at 08:09 PM

Great thanks for the help. Yeah, you are right actually. To pull this off I'll need to communicate with different blueprints. The links you mentioned are really helpful, I'll start studying.

avatar image GullJemonStudios Aug 28 '16 at 10:51 AM

I'm glad I could help. If you need any more help just ask.

avatar image Fl4MES Aug 29 '16 at 01:15 PM

How can I get information from my anim blueprint? Is it the same as as anim notifies?

avatar image GullJemonStudios Aug 30 '16 at 09:25 AM

Hi there. I'm not sure because I've haven't gone into animation blueprint as of now. But I suppose it should work similar to the usual way:

You have to use a "GetAllActorsOfClass"-Node and choose your animation blueprint in the small drop down menu of this node. This will output an array of actors/bluepringts. Use a "Get"-Node and get the 0th element of that array. From this you can now create a reference of your blueprint by promoting the output of the "Get"-Node to a new variable.

Now you have created and filled an actor reference of your animation blueprint and you should be able to access (get and set) all data contained in this script.

Here's some more information: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/FindingActors/Blueprints/

Hope this helps!

avatar image Fl4MES Aug 31 '16 at 04:57 AM

Thats very helpful. Thank you so much

avatar image GullJemonStudios Aug 31 '16 at 08:30 AM

Cool, just make sure you mark my answer as accepted, I would thank you very much for that as well ;)

avatar image Fl4MES Sep 01 '16 at 07:42 PM

Do you have any idea on how I can make my Ai evade and block my attacks? https://answers.unrealengine.com/questions/480034/how-to-get-ai-to-block.html Here is the link to my question. It'll be great if you could take a look at it too. Thanks

(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