- public float smooth = 2.0F;
- public float tiltAngle = 30.0F;
- void Update() {
- float tiltAroundZ = Input.GetAxis("Horizontal") * tiltAngle;
- float tiltAroundX = Input.GetAxis("Vertical") * tiltAngle;
- Quaternion target = Quaternion.Euler(tiltAroundX, 0, tiltAroundZ);
- transform.rotation = Quaternion.Slerp(transform.rotation, target, Time.deltaTime * smooth);
- }
unity3d 网络延时状态下 ,平滑转弯
最新推荐文章于 2022-11-16 17:40:25 发布