【发布时间】:2017-04-07 11:00:22
【问题描述】:
我正在制作多人躲避球游戏,每次启动主机和客户端时,只有一个玩家可以移动。
我希望玩家能够独立移动。这是我的(更新的)代码:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class Script4Network : NetworkBehaviour
{
// Use this for initialization
void Start() {
if (!isLocalPlayer)
{
gameObject.GetComponent<FirstPersonController>().enabled = false;
gameObject.GetComponent<throwing>().enabled = false;
gameObject.GetComponent<HeadBob>().enabled = false;
// gameObject.GetComponent<Camera>().enabled = false;
}
}
void Update()
{
}
}
【问题讨论】: