1
TNet 3 Support / TNManager.isHosting always returning true
« on: February 05, 2016, 03:07:49 PM »
Hi,
So I'm trying to get a spawning system going for target objects controlled by the host. I've got this at the start of the control script:
But for some reason, no matter what I do, TNManager.isHosting always returns true on all the clients and hijinks ensue. Anyone know what's happening? I'm taking this from the tutorial here.
So I'm trying to get a spawning system going for target objects controlled by the host. I've got this at the start of the control script:
- using UnityEngine;
- using System.Collections;
- using TNet;
- public class TargetSpawnControl : TNBehaviour
- {
- public GameObject target;
- public GameObject[] targetSpawners;
- public bool hosting = false;
- void Awake()
- {
- Debug.LogError(TNManager.isHosting);
- if(!TNManager.isHosting) return;
- if(TNManager.isHosting) hosting = true;
- StartCoroutine(StartTargetSpawnTimer());
- }
- }
But for some reason, no matter what I do, TNManager.isHosting always returns true on all the clients and hijinks ensue. Anyone know what's happening? I'm taking this from the tutorial here.