Unity3d存在财产以后的网状撞机2D对象? [英] Unity3d there is somthing like mesh collider to 2D objects?

查看:186
本文介绍了Unity3d存在财产以后的网状撞机2D对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

林制作简单的2D游戏,我设计了道的玩家在游戏中经历的一切。 如果玩家接触墙壁的比赛结束了,所以我必须检测碰撞。

Im making simple 2D game, I designed the "way" the player going through in the game. If the player touches the wall the game is over, so I must detect collisions.

起初,我创建从精灵城墙,但后来我意识到,没有2D撞机适合自己的精神的形状(这是很难从大量的小的多边形和圆形撞机手动创建撞机) ,所以我做了所有的构建的方式3D对象(其中Z = 0.001 .dae文件)的墙壁,并增加了他们一个适合自己的3D对象的混搭撞机。我改变了我的球员是3D,以及使碰撞类型将匹配。 它的工作,但我敢肯定,同样的游戏可以通过更好的工作表现以同样的资源,如果所有的游戏对象是2D的。

At first I created the walls from sprites, but then I realized there is no 2D collider that suit himself to the shape of the sprit(it was to difficult to create the collider manually from a lot of smaller polygon and circle colliders), so I made all the walls that builds the "way" 3D objects(.dae files with z=0.001), and added them the mash collider which suits himself to the 3D object. I changed my player to be 3D as well so the collisions types will match. It worked, but I'm sure the same game can work by much better performance with the same resources if all the game objects were 2D.

怎么能有适合自己到3D对象却是没有了2D一对撞机? 也许我错过了什么?

How can it be that there is a collider that suits himself to a 3D object but there is none for 2D? Maybe I miss something?

推荐答案

克里斯,你是对的,

在我第一次尝试我没有正确导出精灵使多边形撞机didnt recocnized我精神的形状。

At my first attempt I didnt export the sprite correctly so the polygon collider didnt recocnized the shape of my sprit.

我exidently精灵导出为JPEG,当我出口它作为png格式,它的工作就像一个魅力,刚刚添加的多边形撞机,它符合我的精灵造型完美,谢谢!

I exidently export the sprite as JPEG, when I export it as .png it worked like a charm, just added the Polygon Collider and it match to my sprite shape perfectly, thanks!

这篇关于Unity3d存在财产以后的网状撞机2D对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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