Camera.velocity 速度


var velocity : Vector3

Description描述

Get the world-space speed of the camera (Read Only).

获取世界空间中相机的速度(只读)。

This camera's motion in units per second as it was during the last frame.

该相机是自上一帧以秒为单位的运动。

  • C#

  • JavaScript

using UnityEngine;using System.Collections;public class example : MonoBehaviour {void Update() {print("Camera moving at " + camera.velocity.magnitude + " m/s");}}
function Update () {print ("Camera moving at " + camera.velocity.magnitude + " m/s");}


,