HasTakenDamage Attacker Parameter Not Populating

Nicky_g_

Member
I am trying to get the HasTakenDamage from the movement pack to fully function. The enemy I have is able to receive damage and its health drops. I have even attached a log to make sure that it is working correctly and it is except the enemy doesn't populate its Attacker parameter with the character that shot it. I'm not sure how to get the Attack field to populate. I am using the UTPC controller, is there something I'm missing on that end for the enemy to know who it was attacked by?

Thanks!

My BT is attached for reference.
 

Attachments

  • SpiderBehaviorScreenshot.png
    SpiderBehaviorScreenshot.png
    92.2 KB · Views: 5
Is Has Taken Damage being reevaluated? What does the inspector for that task look like?
 
Here is a screen cap. I followed the video you created and tried to reverse engineer the demo but can't figure it out. Is there something I need to add to the Attackers weapon/bullets for the enemy to know who has attacked them?

Thanks for the speedy reply and Happy Thanksgiving!
 

Attachments

  • CaptureOfHAsTakenDamageTask.PNG
    CaptureOfHAsTakenDamageTask.PNG
    59.8 KB · Views: 2
Happy Thanksgiving!

The settings on the task look correct. Is that task being reevaluated? When the tree is active it should have a circle around it with an x indicating that it is being reevaluated but it is currently returning failure. When the agent is damaged the task should then return success.

Another option would be to insert a breakpoint within the event to determine if the damage event is even being called.
 
Yes, it is being reevaluated and the log in the sequence fires off and functions as should. The only thing that isn't happening is that the Attacker field isn't populating.


Off screen I am shooting at an enemy target.

I hope your Thanksgiving was a good one!
 
That looks correct. Since the behavior tree is ticking multiple tasks within a single frame my guess is that the attacker is being set but then it is being reset by another task. You can test this by adding a Wait task within the HasTakenDamage branch.
 
Top