Hey,
right now I’m earning some first grey hair with my first multiplayer game. It’s working quite good so far, because the tutorial explains it very nicely.
Now I’m trying to make my players send beacons (circles that increase in size) after a double click. So I want to spawn the prefab with the animation at the players location. The prefab has a NetworkTransform and Network identity and is listed as spawnable prefab in the NetworkManager. Basicly I do everything like the tutorial tells me to.
The problem is, Unity is coplaining about a missig NetworkIdentity in the “Object”. My question is: Which object? All involved objects have Identities.
public class TouchMyself : NetworkBehaviour {
public GameObject beaconEffect;
public Transform myPlayer;
private float lastClickTime;
private float catchTime = 0.25f;
void Update (){
if (!isLocalPlayer) {
return;
}
if (Input.GetKeyDown (KeyCode.Mouse0)) {
if (Time.time - lastClickTime < catchTime) {
CmdSendBeacon ();
}
lastClickTime = Time.time;
}
}
[Command]
void CmdSendBeacon(){
var beacon = (GameObject)Instantiate (beaconEffect, myPlayer.position, myPlayer.rotation);
NetworkServer.Spawn (beacon);
}
}
EDIT: I just realized, the beacon is being spawned, but the exception is still thrown.