纳金网

标题: 为什么物体移动方向不对,是坐标问题还是哪里的问题。 [打印本页]

作者: 她。    时间: 2013-4-7 11:10
标题: 为什么物体移动方向不对,是坐标问题还是哪里的问题。
代码如下:

using UnityEngine;
using System.Collections;

public class Walk : MonoBehaviour {
        public Transform target;
        // Use this for initialization
        void Start ()
        {
        
        }
        
        // Update is called once per frame
        void Update ()
        {
                transform.LookAt(target);
                if(Input.GetKey("w"))
                        transform.position += transform.forward*Time.deltaTime*3.0f;
                if(Input.GetKey("s"))
                        transform.position -= transform.forward*Time.deltaTime*3.0f;
                if(Input.GetKey("a"))
                        transform.Rotate(0.0f,-3.0f*Time.deltaTime,0.0f);
                if(Input.GetKey("d"))
                        transform.Rotate(0.0f,10.0f*Time.deltaTime,0.0f);
               
               
        }
}

这是哪里的问题, 大伙求教哇~





欢迎光临 纳金网 (http://c-www.narkii.com/club/) Powered by Discuz! X2.5