QQ群:476842922(欢迎加群讨论学习)
将代码拖入到主摄像头上即可实现视角移动
using UnityEngine;
using System.Collections;
public class FSInput : MonoBehaviour {
public float speed=6.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
float deltaX = Input.GetAxis ("Horizontal") * speed;
float deltaZ = Input.GetAxis ("Vertical") * speed;
transform.Translate (deltaX, 0, deltaZ);
}
}
unity3d 视角移动FPSinput第一人称视角移动
最新推荐文章于 2024-02-26 09:58:44 发布