# Full authority transfer issue

**URL:** <https://community.coherence.io/t/full-authority-transfer-issue/708>\
**Category:** Help\
**Created:** [June 20, 2025, 9:52am UTC](https://community.coherence.io/t/full-authority-transfer-issue/708 "2025-06-20T09:52:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjcrypto22002266](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@sjcrypto22002266](https://community.coherence.io/u/sjcrypto22002266)\
**Post date:** [June 20, 2025, 9:52am UTC](https://community.coherence.io/t/full-authority-transfer-issue/708/1 "2025-06-20T09:52:38Z")

</div>

Hi,

I’m trying to transfer networked Mine full authority to Monsters spawning player, so it would explode when Monster steps on it

- All works fine when manually transferring authority in play mode hierarchy inspector
- Could you, please, help me to find issue in code so it would transfer authority before exploding?

Thanks in advance!

> Code that I added into Towers (Mine is considered as Tower) script

using Coherence.Toolkit;  
using Coherence;

```
	public class MineAuthorityTransfer : MonoBehaviour
	{
		public UnitTower unitTower;
		public CoherenceSync sync;

		private void Awake()
		{
			if (sync == null)
				sync = GetComponent<CoherenceSync>();
			if (sync != null)
				sync.OnAuthorityRequest.AddListener(OnAuthorityRequest);
		}

		private void OnAuthorityRequest(AuthorityRequest request, CoherenceSync sync)
		{
			// Only allow full authority to be transferred
			request.Respond(request.AuthorityType == AuthorityType.Full);
		}

		public void TryDetonateIfMonsterInRange()
		{
			if (sync == null)
				return;
			bool hasFull = false;
			var prop = sync.GetType().GetProperty("HasFullAuthority");
			if (prop != null)
				hasFull = (bool)prop.GetValue(sync);
			else
				hasFull = sync.HasStateAuthority && sync.HasInputAuthority;

			if (!hasFull)
			{
				sync.RequestAuthority(AuthorityType.Full);
				return; // Wait for authority before detonating
			}

			// --- The following code should only run after authority is granted ---
			if (unitTower == null) return;

			if (unitTower.IsMine() && unitTower.cooldownMine <= 0)
			{
				List<Unit> tgtList = SpawnManager.GetUnitsWithinRange(unitTower, TowerManager.GetGridSize() * .25f, unitTower.GetTargetGroup());
				if (tgtList.Count > 0)
				{
					unitTower.FireMiscEffect(unitTower.shootEffObj_Mine);
					tgtList = SpawnManager.GetUnitsWithinRange(unitTower, unitTower.GetAOERange_Mine(), unitTower.GetTargetGroup());
					for (int i = 0; i < tgtList.Count; i++)
						tgtList[i].ApplyAttack(new AttackInfo(unitTower, tgtList[i], 2));

					unitTower.cooldownMine = unitTower.GetCooldown_Mine();
					if (unitTower.destroyOnTrigger)
					{
						unitTower.cooldownMine = 999;
						unitTower.Destroyed(true, false);
					}
				}
				else unitTower.cooldownMine = 0.1f;
			}
		}
	}

```

---

<div class="post-metadata">

**Author:** ![brit](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/brit/32/34_2.png) [@brit](https://community.coherence.io/u/brit)\
**Post date:** [June 20, 2025, 12:51pm UTC](https://community.coherence.io/t/full-authority-transfer-issue/708/2 "2025-06-20T12:51:08Z")

</div>

You don’t necessarily need to transfer authority - just send a command that the event happened and that he mine should explode: [Messaging with Commands | coherence Documentation](https://docs.coherence.io/manual/networking-state-changes/commands)

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex017/uploads/coherence/original/1X/b3aa79eb9519fac7aad7eba18f15a1e8ce60f6e2.png) [@system](https://community.coherence.io/u/system)\
**Post date:** [September 18, 2025, 12:52pm UTC](https://community.coherence.io/t/full-authority-transfer-issue/708/3 "2025-09-18T12:52:03Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
