change: ownership can now be be changed on objects

This commit is contained in:
Chris
2025-10-08 22:58:39 -04:00
parent 507a735253
commit 0240f677c4
2 changed files with 14 additions and 26 deletions

View File

@@ -32,6 +32,10 @@ namespace Reset.Units{
}
public void TakeDamage(DamageSource source){
if (UnitIsNetworked()) {
TakeOwnershipRpc((source.source as GameObject).GetComponent<NetworkObject>().OwnerClientId);
}
try {
currentHealth -= source.damageDealt;