Created
January 17, 2020 08:37
-
-
Save but80/1b9fb8dffb020f61dc96255afabea43e to your computer and use it in GitHub Desktop.
Referenceと同じ回転量を適用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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