Skip to content

Instantly share code, notes, and snippets.

@hiyorin hiyorin/Example.cs
Last active Nov 5, 2015

Embed
What would you like to do?
座標間の角度
using UnityEngine;
public class Example : MonoBehaviour
{
public Transform from = null;
public Transform to = null;
private void Update ()
{
// fromをtoへ向ける
Quaternion rotation = Quaternion.LookRotation (to.position - from.position);
to.rotation = rotation;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.