【发布时间】:2015-05-06 10:28:11
【问题描述】:
在这里找到这个答案: Rotate a gameobject in Unity
我发现这非常有用,但我只想将旋转分配给 Z 轴,我无法开始工作。
using UnityEngine;
using System.Collections;
public class Rotation : MonoBehaviour {
public GameObject Player;
public GameObject PlayerCube;
// Use this for initialization
void Start () {
var playerMapPos = Player;
var playerWorldPos = PlayerCube;
PlayerCube.transform.rotation = Player.transform.rotation;
}
// Update is called once per frame
void Update () {
}
}
【问题讨论】:
-
发布您尝试的轮换代码
-
请在使用前阅读标签说明。
unity标签与 Unity 游戏引擎无关。
标签: c# unity3d rotation gameobject