您的位置:首页 > 运维架构

This collider has some illegal parameters. Choose 'Reset' in the component popup menu to fix it

2014-04-18 11:46 525 查看
先看一下面的一个帖子:http://forum.unity3d.com/threads/168714-Error-when-adding-a-BoxCollider-component。原文如下:

1 After calling myGamObject.AddComponent<BoxCollider>() I
get the error "This collider has some illegal parameters. Choose 'Reset' in the component popup menu to fix it" followed by "abb.IsValid()" and then "!isFinite(outDistanceForSort)", "!IsFinite(OutDistanceAlongView)" being printed over and over again.

There are no popup menus to click, like the error suggests. What is causing this and how do I fix
it?

2 Well I found the problem, but not the solution. myGamebject
is created by Instantiating another GameObject that was loaded using Resources.Load("path to mesh"). It looks like the mesh being loaded is getting corrupted, which is strange because I load it in other parts of the code in the same way without issue. The
corruption is screwing up the scaling of the transform and the scale values are either astronomical or NaN.

edit: Finally found the issue. If you set a game object's transform's parent to a transform that already
has a parent, the game object's scale flips out.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: