Version: 5.3 (switch to 5.4b)
言語English
  • C#
  • JS

スクリプト言語

好きな言語を選択してください。選択した言語でスクリプトコードが表示されます。

Quaternion.Lerp

マニュアルに切り替える
public static Quaternion Lerp(Quaternion a, Quaternion b, float t);

パラメーター

説明

ab の間を t で補間し、その後、その結果を正規化します。パラメーター t は、[0, 1] の範囲です。

Slerp よりも高速ですが、回転が互いに離れている場合、見た目は劣ります。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { public Transform from; public Transform to; public float speed = 0.1F; void Update() { transform.rotation = Quaternion.Lerp(from.rotation, to.rotation, Time.time * speed); } }

See Also: Slerp. LerpUnclamped.