private int zRotation;
public GameObject obj;

public void Update()
{

  //obj = GameObject.Find("Camera");    //获取名为Camera的相机对象  

  zRotation = player.transform.eulerAngles.y;  //player是unity第一人称

  compass.transform.eulerAngles = new Vector3(0, 0, zRotation);  //改变image的Z轴rotation
}

相关文章:

  • 2021-10-16
  • 2021-05-26
  • 2021-08-14
  • 2021-07-31
  • 2021-09-07
  • 2021-11-06
  • 2022-12-23
  • 2021-11-06
猜你喜欢
  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2021-06-29
  • 2021-11-21
  • 2021-09-19
  • 2021-10-06
相关资源
相似解决方案