Unity3D:找到并销毁未触及的物体到地板

发布于 2025-02-12 00:22:15 字数 342 浏览 0 评论 0原文

我有一个关于查找和销毁3D对象的问题,该物体与地板(平面)没有相撞。但是物体不需要直接与地板碰撞。他们可以与邻居对象碰撞。

例子。

与B对象碰撞的0个设备和B对象与地板碰撞(返回true) 与C对象相撞的对象,但C不与地板相撞(返回false)

有没有人可以提供帮助的对象?

最好的问候

“

I have a question about find and destroy 3D objects which is not collided with floor (Plane). But objects can't need collide directly with the floor. They can collide with neighbour objects.

Example.

A 0bject colliding with B object and B object colliding with floor (return true)
A object colliding with C object but C not colliding with floor (return false)

Is there anyone who can help ?

Best Regards

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

稳稳的幸福 2025-02-19 00:22:15

如果一个对象与地板标签相撞,则用布尔值碰撞,则如果对象与另一个对象碰撞,请检查其他对象是否用上述布尔值标记,如果这样也标记了另一个对象。

因此,如果对象A与地板相撞,请用布尔值标记它正在触摸地板。

然后,当对象B与对象A发生碰撞时,请检查对象A是否具有此地板标签。

如果确实对象B也应标记。

如果不反对B与与地板相撞的物体碰撞,那么什么也不做。

If an object would collide with the floor tag it with a boolean, then if a object collides with another object check if the other object is tagged with said boolean if so tag the other object as well.

So if Object A is colliding with the floor, tag it with a boolean saying it is touching the floor.

Then when Object B is colliding with Object A, check if Object A has this floor tag.

If it does Object B should also be tagged.

If it does not Object B is not colliding with an object colliding with the floor, so do nothing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文