在层次结构中旋转派生对象会缩放它们吗?

发布于 2024-11-01 06:58:46 字数 166 浏览 1 评论 0 原文

在一项任务中,我被告知要通过制作游乐设施来试验 Unity 层次结构。我创建了一个可以上下移动的表面,效果很好。当我向上下移动的表面添加新对象并尝试旋转它们时,它们也会同时缩放。我不知道为什么会发生这种情况。我尝试将它们放在根对象之外,然后将它们添加进去,但它做了同样的事情。如果有人可以提示我做错了什么,那就太棒了。

For an assignment I was told to experiment with the Unity hierarchy by making an amusement ride. I created a surface that moves up and down that works fine. When I add new objects to the surface that moves up and down and attempt to rotate them they also scale at the same time. I'm not sure why this happens. I have tried making them outside of the root object then adding them in but it does the same thing. If someone could give me a hint as to what I'm doing wrong that would be awesome.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鸩远一方 2024-11-08 06:58:46

如果它们在您将它们添加到表面时立即缩放,那么您之前可能缩放过表面。在对象层次结构中,所有对象都继承其父对象的转换。

您可以通过使用空对象创建树并仅将可见对象附加为叶子来避免这种情况。
不要这样做(这将导致子对象根据表面的比例进行缩放):

Surface
+SubObject 1
+SubObject 2

您可以这样做:

EmptyObject (scale 1)
+Surface
+SubObject 1
+SubObject 2

这应该可以解决您的问题

If they scale right in the moment when you add them to the surface, then you probably scaled the surface before. In an object hierarchy all objects inherit the transformations of their parents.

You can avoid that by creating your tree with empty objects and only attach the visible objects as leafs.
Instead of doing it this way (which will result in the sub-objects beeing scaled according to the scale of the surface):

Surface
+SubObject 1
+SubObject 2

You can do it that way:

EmptyObject (scale 1)
+Surface
+SubObject 1
+SubObject 2

That should solve your problem

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文