【发布时间】:2023-01-10 15:51:22
【问题描述】:
我正在尝试从两个 Vector2 位置获取角度。
这些点是通过以下光线投射代码找到的:
RaycastHit2D hit = Physics2D.Raycast(groundedPos.transform.position, Vector3.down, 1, lmask); // lmask is only the blocks
Vector2 firstPos = hit.point;
RaycastHit2D hit2 = Physics2D.Raycast(groundedPos.transform.position + new Vector3(5f, 0, 0), Vector3.down, 1, lmask);
Vector2 secondPos = hit2.point;
我如何从这两个 Vector3 点获得角度?
在此之后我需要改变我的对象的旋转。
【问题讨论】: