在Unity 3d 4.3中,冲突检测不起作用.有两个物体,两个物体都具有刚体分量 [英] In Unity 3d 4.3, collision detection is not working. There are two objects, both objects have rigidbody component

查看:76
本文介绍了在Unity 3d 4.3中,冲突检测不起作用.有两个物体,两个物体都具有刚体分量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用两个都具有刚体分量的对象. 但是两个对象都没有彼此通过.

I am using two objects both having rigidbody component. But both object is not passing each other.

使用一个对象作为平台

road.Translate(0,0, -speedcal * Time.deltaTime);

在游戏开始时(例如在Temple运行中)立即使用object.Translate方法.

using object.Translate method as soon as game starts like in Temple run.

现在,在我的游戏中,新的道路(平台对象)生成正常. 但是玩家和道路并没有冲突.他们彼此相依.

Now in my game new road(platform object) generation is working fine. But player and road is not colliding. they pas though each other.

任何人都可以告诉我如何与已平移的对象一起使用碰撞检测或刚体.

Can anyone tell me how to work collision detection or rigidbody together with object already Translating.

推荐答案

我可以考虑三种可能的原因;检查您是否处于这种情况下:

I can think about three possible causes; check if you are in those situations:

  • 您的对象没有附加非运动刚体.如文档.

如果您已配置层碰撞矩阵(编辑->项目设置->物理),则应检查两个对象都在同一层,或者它们的层之间是否可以相互作用(如Thaven在其评论中所述).

If you have configured the Layer Collision Matrix (Edit->Project Settings->Physics), you should check that both objects have are in the same layer, or that their layers can interact with each other (as Thaven told in his comment).

您的速度(speedcal)确实很高,您遇到了"弹丸纸"问题.基本上,在这种情况下,物体的速度太高,并且碰撞检测系统无法检测到相交.

Your velocity (speedcal) is really high, and you are encountering a "bullet through paper" problem. Basically, in this case, the velocity of an object is too high and the collision detection system cannot detect the intersection.

这篇关于在Unity 3d 4.3中,冲突检测不起作用.有两个物体,两个物体都具有刚体分量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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