- 最后登录
- 2017-5-15
- 注册时间
- 2012-3-1
- 阅读权限
- 90
- 积分
- 32973
- 纳金币
- 32806
- 精华
- 12
|
代码如下:
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);
}
}
这是哪里的问题, 大伙求教哇~
|
|