1.UGUI点击按钮时穿透到地面,导致角色跟着移动,解决办法是在控制人物移动的脚本里,update函数中添加一个条件:
if (EventSystem.current.IsPointerOverGameObject())//点击到UI上
{
Debug.Log("Clicked on the UI");
}
2.让UI永远朝向摄像机
void Update()
{
this.transform.rotation=Camera.main.transform.rotation;
}
小白入门做点笔记,勿喷。