Paragon assets as enemy ai
I am using the free paragon assets and am wondering how I can use them as an ai to attack me in my game. I have been looking around and have found nothing useful so I figured I would ask here.
asked Jan 28 '19 at 08:30 AM in Using UE4
That's a pretty vague question.
If you're just looking to add AI into your game using the Paragon assets, there are a ton of useful tutorials on YouTube, and plenty of documentation on the Epic website.
I'm assuming you're using blueprints, which is fine, makes things easier. Do some searching for AI blueprints on Google and you'll find information you're looking for.
answered Jan 29 '19 at 08:31 PM
It is a little bit complex but not too difficult. You'd want to set up a basic ai to follow you first, now you can use behavior trees or you can use the character blueprints to do so. Personally I prefer the second option as it requires far less communication between blueprints to deal damage etc, but more professional users will most likely opt for behavior trees.
A simple follow and attack AI in blueprints would go something like:
Event Tick --> Branch (make a boolean variable called IsAttacking for your condition) and connect the false to --> Branch (make a boolean variable called InRange for your condition) and connect false to the node --> --> AI Move To where target actor is "Get Player Character". Set an acceptance radius where they can reach you with their weapons. That takes care of movement.
The true pin in the branch which has the inrange condition would be connected to set the boolean variable "IsAttacking" to true, then ---> Play animation or anim montage where you have set up animation notifies, one that marks when you want the weapon to do collide with the player (ie be able to do damage) and one where you turn the collision off (otherwise the enemy can simply run into the player and do damage to it) --> You would then add a delay to allow it to finish it's attacking animation --> Then set the boolean "IsAttacking" to false so it can move again.
Of course you would need to set up animation blueprints for movement and use the animation notifies to call an event in your blueprint allowing it to deal damage and likewise in your playable characters blueprint to allow it to take damage.
It's all pretty involved and there are quite a few steps to it, it's hard to explain in text really. But there are tons and tons of tutorials for making basic AI out there. And don't worry, it might seem difficult but once you learn how to do it and you have the assets available to you (as in the character model and the animations), you'd be able to set something like this up in 10-20 minutes easily. But it requires some effort to learn the basics.
What I explained above is a simple way of moving and attacking while making sure that if the character is attacking, it cannot attack again until the first attack is finished. It also makes sure the AI won't move while it is attacking.
Follow this question
Once you sign in you will be able to subscribe for any updates here