Hi guys can you help me with this please, i have wolf AI, for example if I have 5 or 3 wolfs on the map then they are all dealing dmg to me, but if i place for example 10 of those enemies then for some reason there is no dmg from them, only 1 or 2 are dealing dmg to me, yet they are all using same animations, character bp, anim bp, etc… Im determining damage with anim notify. Please help
It sounds like you may be confusing “instances” versus “classes” perhaps? Or target actors?
There is no particular limit to the number of actors that can deal damage to other actors in Unreal, so this is you doing something wrong in wiring up the damage dealers, or wiring up damage receiving in your player pawn class.
It’s impossible to debug this without more information about how your wolf actor finds the target to deal damage to, and deals damage, and how your player pawn receives damage.
I recommend setting breakpoints in the “deal damage” functions/nodes, as well as your player pawn “receive damage” events, and stepping through them to see where the intended flow goes wrong.
I believe its problem here, its like they are losing target when there are too many of them, even they are doing animations in front of me, just not damaging me.
What event do you trigger what you’ve shown? I.e. an overlap event? Is it working if you’ve got 10 wolves on the map and only one attacks you or is it not working when they all attack you at the same time? I’m just wondering if its something to do with them all crowding round you and the collision component not overlapping with the player collision capsule as you’d expect.
If you think I’m on to something then try un-ticking the hidden in game option for your wolf collision component and player collision component to see if when you’re being attacked the two components are actually overlapping.
@something45 @jwatte All of my wolfs are doing the animations properly and their behavior is good, the only problem im having is that when there is more than 5 of those enemies then 3 of them deals dmg while other 7 are not ( and those 3 are always different).
I will send you whole event now for dealing dmg and playing animation.
I dont think i see anything wrong with your events.
However you are using the SphereOverlap, which leads me back to my previous post about whether the components are actually overlapping. What happens if you increase the Damage Radius variable to something bigger, does this lead to ‘applydamage’ more often?
Otherwise you might want to do as @jwatte suggested and use breakpoints, or maybe use print strings and append (where the A pin has the instance of the class thats executing the print string and the B pin has the message you want to output, which might help to debug the error. I believe you can use ‘Self->DisplayName’ to get a value you can use to recognise the instance, however, I’m not 100% sure thats right so you’d need to test that.
You are right, I think you found the problem, they are overlapping with each other and I think that’s the problem. @something45
Any ideas how to fix this ?
Here are my sphere nodes and event
In your OnComponentEndOverlap your using Get Target, but I think you might want to store the target you get on BeginOverlap to a variable and check for this when you EndOverlap, then clear target if there’s a match to this.
Also, I’m not sure why you’re having to do a check for Self in BeginOverlap, does this ever equate to false pin and if so, you might want to see about fixing whatever is causing that as it doesn’t seem right.
You might want to look at AI Perception if you haven’t already:
Sorry, I don’t think what I suggested will fix your issue after having another look as the target you’re setting is only used when setting the pawn rotation from what I can see.
Are the wolves that don’t do damage doing anything differently I.e. not playing the anim montage/not rotating towards you etc.
Thank you for your answer and trying to help me, they are not doing anything differently only problem here is the damage, i will try to play (play with nodes) with the solution you gave me I also think that the problem here is with overlapping spheres, because when i place them in the world while overlapping in the game they are not dealing damage , at least none of them
Try adding a Draw Debug Sphere after SphereOverlapActors so you can see whats actually being created. This might help with debugging.
Thank you so much <3