角色在玩了一段时间后从地面掉下来 [英] Character fall through ground after playing sometime

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

问题描述

我有一个使用复合对撞机设置的角色(该对撞机由许多原始的对撞机形状设置,每个身体部位均设置一个),并且使用简单的地面使用比例缩放的立方体进行设置.多维数据集在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. 选择合适的对撞机(如果是Terrain,请检查最后一个选项卡,小齿轮)

  • 注意:网格碰撞器可能会引起问题.

    • 特别是,如果FallingObject和GroundObject都具有网格碰撞器.
    • 尤其是如果网格物体是动画的.
    • 为避免网格物体碰撞,您可以从多个原始碰撞器(在父,子或同级GameObjects中)构建近似的网格形状.
    • 如果无论如何都需要网格碰撞器,则可以尝试将其他基本碰​​撞器放置在不会强制"碰撞的位置.

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

    Is the Object a Trigger? If so,

    1. 选择对象
    2. 找到其对撞机组件(如果是Terrain,请检查最后一个选项卡,小的齿轮)
    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开头),直到绿色轮廓完全适合角色 (如果您得到的值真的很奇怪,可能是由于缩放(例如,您的网格太大,因此您将尺寸缩小到了.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))

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

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

    • FallingObject-Collider和GroundObject-Collider相交.
      将对象移到地面以上(已从相当高的高度跌落以用于测试目的).
      所有的!不只是对撞机或与之相连的其他物品(例如,角色控制器的摄像头)
      注意:即使被禁用,拨通(灰色胶囊"?)也可能会引起问题. (我不确定这对我自己意味着什么,对不起...发布此解决方案的答案不是很具体=/)
    • FallingObject-Collider and GroundObject-Collider intersect each other.
      Move the Object much above the ground (have it fall from some considerable hight for test-purposes).
      All of it! Not just the collider or something else that is attached to it (e.g. the Camera of a Character Controller)
      Note: a poking-through ("grey capsule"?) may cause Problems even if it's disabled. (I am not sure what that means myself, I'm sorry... the answer that posted this solution was not very specific =/ )
    • 在将对象拖到场景中之前(如果已经存在,则删除它),

    • 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所附着的各个对象(通常是Camera)的父对象作为父对象,否则产生的"dog-chases-tail"场景将导致掉落. 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工具包资产包制作地形来破坏Terrain Collider.

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

    碰撞矩阵可能会引起麻烦.

    Collisionmatrix may cause trouble.

    1. 转到编辑/项目设置"
    2. 物理
    3. collisionmatrix

    • FallingObject的脚本带有'transform.Translate'或'transform.position ='或其他各种'funky'脚本.
      这可能会使对象违反其意愿"通过对撞机.尽量避免它. (例如,使用速度"或尝试SimpleMove)
    • FallingObject has a script with 'transform.Translate' or 'transform.position = ' or various other 'funky' scripting.
      This may push the Object through the collider 'against its will'. Try to avoid it. (e.g. use 'velocity' or try 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天全站免登陆