using UnityEngine; using System.Collections; using System.Collections.Generic; public class walk : MonoBehaviour { // Start is called before the first frame update void Start() { } public void Update() { if(Input.GetMouseButtonUp(0)) { //move滑鼠點一下,就向前移動 transform.position = Vector3.Lerp(transform.position, transform.position+new Vector3(0, 0, 2), 0.3f); } } }