简体   繁体   English

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

[英]Unity3D : Find and Destroy Untouched Objects to Floor

I have a question about find and destroy 3D objects which is not collided with floor (Plane).我有一个关于查找和销毁不与地板(平面)碰撞的 3D 对象的问题。 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) A 0bject 与 B 对象碰撞,B 对象与地板碰撞(返回 true) A 对象与 C 对象碰撞但 C 不与地板碰撞(返回 false)

Is there anyone who can help ?有没有人可以帮忙?

Best Regards此致

在此处输入图像描述

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.因此,如果对象 A 与地板发生碰撞,请用布尔值标记它,表示它正在接触地板。

Then when Object B is colliding with Object A, check if Object A has this floor tag.然后当对象 B 与对象 A 发生碰撞时,检查对象 A 是否具有此楼层标签。

If it does Object B should also be tagged.如果是,对象 B 也应该被标记。

If it does not Object B is not colliding with an object colliding with the floor, so do nothing.如果它没有,对象 B 没有与与地板碰撞的对象发生碰撞,所以什么也不做。

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

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