having AI to deal damage to player

Hi can anyone help me out with the AI applying damage to the player I seem to have everything (I think) and I cant get any line trace for the ai to work.

I have behaviour tree, tasks, damage interface, pawn sensing and I cant figure out or YouTube to help me with the ai to hurt the player character.
I would appreciate any feedback, thank you

Hey @LWHITTY12!

You’ll need to provide screenshots of all the related parts of your Event Graphs to get help, we don’t have any info right now.

However I do have a guess based on this sentence:

Are you performing the traces on the Visibility channel by any chance?
If so, check out this post of mine!

If not tho, get back to us with all the necessary info. If you’re not able to upload too many images on this platform, you can upload a video showcasing them all to YouTube and share the link.

So, hope this helps! :innocent:

thank you for getting back to me ill send the event graph


sorry i wish this site allowed multiple embedded images

You base damage appears to be set to 0 (no damage).

ye i did change it after i still didnt work sadly.

Does the branch where you check for interfaces ever fail? Place a print string there to verify. Assuming all your behavior tree logic is sound and the linetrace gets triggered? if not then your issue could be in another place, where you trigger the linetrace

the print string doesn’t work either.
my friend is working on it and found some form of a solution. and i maybe beable to work on it if it work as i like it to

I’ll assume you’re dealing with a projectile (non-melee) weapon since your trace only fires once. That said, your images are too blurry to make out the details; so, I’ll just point you to resources.

Below is a tutorial series, which includes all aspects of basic enemy AI.

Smart Enemy AI | (Part 1: Behavior Trees) | Tutorial in Unreal Engine 5 (UE5)

Also, you might also fill in the node inputs completely:

By the way, below is the actual tutorial I used to setup weapon collisions. I then just reused it in the enemy BPs.

Unreal Engine Hack & Slash Tutorial Part 8 | Weapon Collisions