角色在玩了一段时间后掉到地上 [英] Character fall through ground after playing sometime

查看:21
本文介绍了角色在玩了一段时间后掉到地上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有复合碰撞器设置的角色(由许多原始碰撞器形状设置的碰撞器,每个身体部位一个),以及一个使用缩放立方体设置的简单地面.立方体在 x 轴上缩放 1000,在 z 轴上缩放 30.事情还处于早期阶段,所以没有昂贵的图形,只有原始形状和场景中的低多边形角色.开始时一切正常,但有一段时间,在我玩了一段时间后,角色开始从地上掉下来.有没有人遇到过这个问题并且知道如何解决这个问题?

I have a character with compound collider setup (the collider that is setup by many primitive collider shapes, one for each body parts), and a simple ground that is setup using a scaled cube. The cube is scaled 1000 in x and 30 in z axis. Things are still in early stage, so there is no expensive graphic, there are just primitive shapes and a low-poly character in scene. Things are going fine at begin, but for some time, after I play for a while, the character start falling through the ground. Anyone has encountered this problem and know how to fix this?

推荐答案

这里 是 SisterKy 的一个很好的可能原因的参考列表.

Here is a good reference-list of possible reasons by SisterKy.

  • 对象有碰撞器吗?如果没有,

  • Does Object have a Collider? If not,

  1. 选择对象
  2. 转到顶部栏
  3. 组件
  4. 物理
  5. 选择合适的碰撞器(如果是地形,请检查最后一个选项卡,小齿轮)

  • 注意:mesh-collider 可能会导致问题.

    • 特别是,如果 FallingObject 和 GroundObject 都具有网格碰撞器.
    • 特别是如果网格是动画的.
    • 为了避免网格碰撞,您可以从几个原始碰撞器(在父级、子级或兄弟级游戏对象中)构建网格的近似形状.
    • 如果你无论如何都需要一个网格碰撞器,你可以尝试在它们不会妨碍强制"碰撞的地方放置额外的原始碰撞器.

    对象是触发器吗?如果是这样,

    Is the Object a Trigger? If so,

    1. 选择对象
    2. 找到它的碰撞器组件(如果是地形,检查最后一个选项卡,小齿轮)
    3. 删除'IsTrigger'的检查
    1. select Object
    2. find its Collider-Component (if Terrain, check the last tab, the little cog-wheel)
    3. remove the check of 'IsTrigger'

  • 对撞机是否放置好?摆弄中心、大小和皮肤宽度(从 0.1 开始)直到绿色轮廓大致适合角色(如果您得到非常奇怪的值,那可能是由于比例问题(例如,您的网格太大,因此您将尺寸缩小到 0.01))

  • Is the Collider placed well? fiddle with center, size and skin-width (start with 0.1) until the green outline aproximately fits the character (If you get really strange values, it might be due to scale (e.g. your mesh was way too big so you downsized to .01))

    您可以尝试将所有定位(包括 unity 和您的建模程序)归零

    You may try to zero out all positioning (both unity and your modeling-program)

    • FallingObject-Collider 和 GroundObject-Collider 相互交叉.
      将物体移到离地面很远的地方(为了测试目的,让它从某个相当高的高度掉下来).
      所有的!不仅仅是对撞机或附加到它的其他东西(例如角色控制器的相机)
      注意:戳穿(灰色胶囊"?)可能会导致问题,即使它被禁用.(我自己也不确定这意味着什么,对不起……发布此解决方案的答案不是很具体 =/)
    • 在将对象拖入场景之前(如果已经存在则删除),

    • Before dragging Object into the Scene (delete if already there),

    1. 查看层次结构
    2. 找到模型
    3. 属性
    4. 选中生成碰撞器"
    5. 点击应用
    6. 现在拖到场景中

  • 法线是否正确?你可能需要

  • Are the Normals correct? You may have to

    1. 回到你的建模程序
    2. 点击翻转/反向法线

  • 网格干净吗?
    据报道,单个 2 顶点三角形"导致了严重的碰撞器问题.

  • Is the Mesh clean?
    Reportedly a single 2-vertex-"triangle" caused bad collider-issues.

    几何体相当复杂?然后你需要将 Mesh-Collider 设置为凸面

    Geometry is rather complex? Then you need the Mesh-Collider set to convex

    1. 选择对象,
    2. Mesh-Collider-Component
    3. 勾选IsConvex"

    • 是否应用了刚体?如果没有,

    • Is a Rigidbody applied? If not,

    1. 选择下落物体
    2. 顶部栏
    3. 组件
    4. 物理
    5. 刚体

  • 是否应用了重力?如果没有,

  • Is Gravity applied? If not,

    1. 选择下落的物体.
    2. 找到它的刚体组件.
    3. 检查重力"

  • 有一个 MouseOrbit 吗?

  • And has a MouseOrbit?

    确保 MouseOrbit 永远不会将 MouseOrbit 附加到的相应对象(通常是相机)的任何父对象作为 MouseOrbit 目标或由此产生的狗追逐尾巴"场景将导致坠落.http://answers.unity3d.com/questions/161386/third-person-controller-falls-through-terrain-upon.html

    Make sure MouseOrbit never has/picks up any parent of the respective object that MouseOrbit is attached to (usually the Camera) as MouseOrbit-target or the resulting 'dog-chases-tail'-scenario will cause falling. http://answers.unity3d.com/questions/161386/third-person-controller-falls-through-terrain-upon.html

    • 有传言说,Terrain Collider 可能会因为使用地形工具包资产包来制作地形而搞砸了.

    • Rumor has it, that Terrain Collider may be screwed up by using the terrain toolkit asset package to make the terrain.

    Collisionmatrix 可能会引起麻烦.

    Collisionmatrix may cause trouble.

    1. 转到编辑/项目设置
    2. 物理
    3. 碰撞矩阵

    • FallingObject 有一个带有transform.Translate"或transform.position ="或其他各种时髦"脚本的脚本.
      这可能会违背其意愿"推动对象通过对撞机.尽量避免它.(例如,使用速度"或尝试 SimpleMove)

    尤其是 mac 版本在面对太多多余的废话时似乎有点问题.可能会以某种方式禁用所有碰撞器.

    especially the mac-version seems to be a bit buggy when faced with too much superfluous crap. may somehow disable all colliders.

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆