void Update ()
{
if (walking)
{
transform.position = transform.position + Camera.main.transform.forward * .5f * Time.deltaTime;
}
Ray ray = Camera.main.ViewportPointToRay(new Vector3(.5F, .5F, 0)); //this is line 23
RaycastHit hit;
对我而言似乎合乎逻辑,但是我得到了
“对象引用未设置为对象的实例”错误。