一些 3D 艺术资源包导出模型时使 z 轴朝上。Unity 中的大多数标准脚本都假定 y 轴代表 3D 世界中的__向上__。在 Unity 中修复旋转问题通常比修改脚本来适配的做法更容易。
如有可能,建议在 3D 建模应用程序中修复模型,使 y 轴在导出前朝上。
如果不可能这样做,可在 Unity 中通过添加额外的父级变换来修复此问题:
1.使用 GameObject > Create Empty 菜单创建空__游戏对象__ 1.调整新游戏对象的位置,使其位于网格的中心或您希望对象旋转时围绕的任意点。 1.将网格拖动到空游戏对象上
现在,您已使网格变为具有正确方向的空游戏对象的__子级__。每当编写使用 y 轴作为向上方向的脚本时,将这些脚本附加到__父级__空游戏对象。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.