【狼】unity3d collision获取碰撞的点的位置
void OnCollisionEnter(Collision ctl) { ContactPoint contact = ctl.contacts[0]; Quaternion rot = Quaternion.FromToRotation(Vector3.up, contact.normal); Vector3 pos = contact.point; }
pos 即为碰撞的点的位置
void OnCollisionEnter(Collision ctl) { ContactPoint contact = ctl.contacts[0]; Quaternion rot = Quaternion.FromToRotation(Vector3.up, contact.normal); Vector3 pos = contact.point; }
pos 即为碰撞的点的位置