private void FixedUpdate()//只有在FixedUpdate执行完后才会更新碰撞
{
transform.Translate(new Vector2(speed, 0));
if(Physics2D.Raycast(gameObject.transform.position,Vector2.left,0.1f,TurnLayer))
{
transform.Rotate(Vector3.up,180);//沿Y轴旋转180°
}
}
在Unity中添加完动画,射线检测就不起作用了

Unity中添加完Animator后射线检测失去作用
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-