简体   繁体   English

Unity 刚体在 boxcollider2d 边缘被推开

[英]Unity rigidbody pushed away on boxcollider2d edge

My two vertical raycast at the feet check if the player is on the ground.我在脚下的两个垂直光线投射检查玩家是否在地面上。 The others check if the player collides in a specific direction.其他人检查玩家是否在特定方向碰撞。 My problem is when the player hits the ground on the edge, he will first be on the ground for a very short time and then just fall.我的问题是,当玩家在边缘撞到地面时,他会先在地面上停留很短的时间,然后才摔倒。 Any ideas how I can fix that he stays on the edge and not just fall?我有什么想法可以解决他留在边缘而不是摔倒的问题吗? I tested it by moving the player on the edge and change its y axis higher.我通过在边缘移动播放器并将其 y 轴调高来测试它。 He then just be on the ground for a very short time and slides to the sides.然后他就在地上很短的时间,然后滑到两边。 The velocity changes to zero when the player hits the ground.当玩家着地时,速度变为零。 He doesnt slide down when i just put him there without height.当我把他放在没有身高的地方时,他不会滑下来。

在此处输入图片说明

我通过减少项目设置中的固定时间步长和最大允许时间步长来修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM