Skip to content

Instantly share code, notes, and snippets.

@but80
Created January 17, 2020 08:37
Show Gist options
  • Save but80/1b9fb8dffb020f61dc96255afabea43e to your computer and use it in GitHub Desktop.
Save but80/1b9fb8dffb020f61dc96255afabea43e to your computer and use it in GitHub Desktop.
Referenceと同じ回転量を適用
using UnityEngine;
public class CopyRotation : MonoBehaviour
{
public Transform Reference;
Quaternion rotator;
void Start()
{
rotator = Quaternion.LookRotation(transform.forward, transform.up);
}
void Update()
{
transform.rotation = rotator * Reference.rotation;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment