一、通过鼠标点击,物体跟着移动(RayTest文本)
//射线(通过点击鼠标,物体跟着移动)
//1.对Plane 添加标签Ground;只有对地面才打印信息,点其他的无效
//2、对胶囊体、物体添加character Controller组件和刚体,,获取组件在start里添加一次就行,文件给了胶囊体。
-------------------------------------------------------------------------------------------------------------------------------------
privateCharacterController m_CharacterController;
privateVector3 target;
1.void Start () {
m_CharacterController =GetComponent<CharacterController>();//获取组件
target = transform.position; //目标
}