浏览代码

Fixed bouncing issue when player hit under floating platform

/main
mwert09 4 年前
当前提交
90d34bde
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 7
      UOP1_Project/Assets/Scripts/Characters/Character.cs

7
UOP1_Project/Assets/Scripts/Characters/Character.cs


// check if the controller is grounded and above slope limit
// if player is grounded and above slope limit
// player has to slide
currentSlope = Vector3.Angle(Vector3.up, hitNormal);
shouldSlide = currentSlope >= characterController.slopeLimit;
if (characterController.isGrounded)
{
currentSlope = Vector3.Angle(Vector3.up, hitNormal);
shouldSlide = currentSlope >= characterController.slopeLimit;
}
}
}
正在加载...
取消
保存