Unity3D:找到并销毁未触及的物体到地板
我有一个关于查找和销毁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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果一个对象与地板标签相撞,则用布尔值碰撞,则如果对象与另一个对象碰撞,请检查其他对象是否用上述布尔值标记,如果这样也标记了另一个对象。
因此,如果对象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.