HasTakenDamage

Hi!

I haven’t fully debugged yet, I haven’t delved into the process of how damage is applied. But in the HasTakenDamage task, in the OnDamage method, I expected the attacker object to come, but it is null.
 
I just tried it and the attacker wasn't null. In the Deathmatch AI Kit I use this variable to determine which agent to attack. If you place a breakpoint can you back track it to see why it is being set to null?
 
Hello, at the moment we also have Pun here, but at this stage Offlinemode. The script tries to find the rifle that fired the shot in the inventory, but apparently does not find it.

1651736800282.png
 
Ah, PUN adds another layer of complications. Has the item been added to the inventory? I would step through GetItem to determine why the item is not being found.
 
Ah, you are using UIS as well. The inventory system doesn't support PUN so that's likely the issue. Unfortunately we haven't tried adding support for PUN yet so I'm not sure what it will take.
 
Hi.

Here's what worked for me:
I'm iterating through the collection of equipped weapons to find the currently active one, what is in my hands, believing that it was it that fired the shot, because the damage carrier was the spawned projectile.

1651828209336.png
 
I'm at a loss in logic, if we know that the originator of the PhotonViewID is the one who caused the damage, why look for how he caused the damage, in the end, in order to take the owner
 
Unfortunately it's really hard for me to debug without trying it out myself and stepping through the code. We do have plans on adding pun support to UIS but right now the priority is version 3 of the character controller.
 
Top