当前位置:网站首页>【解决】修改子物体Transform信息导致变换不对称、异常问题的解决方案
【解决】修改子物体Transform信息导致变换不对称、异常问题的解决方案
2022-06-11 22:16:00 【野奔在山外的猫】
开发平台:Unity
编程平台:Visual Studio 2020以上
使用语言:C#
问题描述
在修改、调整 GameObject 子对象的 Transform 组件信息时,出现的因修改 Rotation 组件值导致与实际期望不符合的问题。如下图所示:
更多说明:
- 物体01、物体02、物体03、嵌套空 所代表的对象均为 Empty GameObject。且 Transform 组件下 Scale 数值均不为1.
- 圆柱体 为外部模型资源导入对象。在 AssetDatabase 中设置 Scale Factory 为默认值。
- Cube、Plane 的 Transform 组件值均使用默认值大小。
问题原因:
在 Unity 世界中,Scale 数值的大小基于其父对象的 Scale 值大小进行等效变化。即父对象大小发生变化时,子对象应具备其对应的变化大小。默认情况下,可理解 Hierarchy 面板中无父对象的 GameObject 对象视为 场景世界的子对象。如上图所示,对形变大小的情况进行了以下排查:
- 排查 嵌套子对象下,被嵌套对象的子对象的形变情况。
- 排查 引用外部模型,进行观察嵌套情况下子对象的形变情况。
- 排查 因 GameObject 对象不同下的子对象形变情况。
解决方案
规范所有确认使用的 Mesh Renderer、Mesh Filter 组件的 GameObject 对象的父对象及其路径上所有父对象。使其所有的父对象 Scale 值均控制在数值1上。例如 国企旗杆 模型进行内部分解:
- Empty GameObject
= 国旗旗帜 模型
= 国旗旗杆 模型
= 国旗平台 模型
若细化 国旗旗杆 模型还需细化,则应当如下:
- Empty GameObject
= 国旗旗帜 模型
= Empy GameObject
= 国旗旗杆 模型
= 国旗缆绳 模型
= 国旗平台 模型

边栏推荐
- R语言书籍学习03 《深入浅出R语言数据分析》-第八章 逻辑回归模型 第九章 聚类模型
- Unity3D getLaunchIntentForPackage 获取包返回null问题
- 还在直接用 localStorage 么?该提升下逼格了
- [Yu Yue education] Yancheng Normal University Advanced Algebra reference
- 机器学习之Logistic回归简单实例
- leetcode 257. Binary tree paths all paths to a binary tree (simple)
- [academic related] under the application review system, how difficult is it to study for a doctoral degree in a double first-class university?
- SVN本地部署server和cleint 并用阿里云盘自动备份
- crontab中定时执行shell脚本
- The shortcomings of the "big model" and the strengths of the "knowledge map"
猜你喜欢

360 online enterprise security cloud is open to small, medium and micro enterprises for free

Two methods to judge the storage of large and small end

The college entrance examination is over, and life has just begun. Suggestions from a 10-year veteran in the workplace

揭秘爆款的小程序,为何一黑到底

Huawei equipment configuration h-vpn

R language book learning 03 "in simple terms R language data analysis" - Chapter 10 association rules Chapter 11 random forest

Basic operation of graph (C language)

如果重来一次高考,我要好好学数学!

超标量处理器设计 姚永斌 第2章 Cache --2.2 小节摘录

Tkinter学习笔记(四)
随机推荐
【JS】1347- localStorage 的高阶用法
Win10弹出USB时出现该设备正在使用的解决方法
SequenceList顺序表的实现
MATLAB点云处理(二十四):点云中值滤波(pcmedian)
Conception du Processeur superscalaire Yao yongbin chapitre 2 cache - - sous - section 2.4 extrait
The shortcomings of the "big model" and the strengths of the "knowledge map"
判断链表是否为回文结构
Unity3d getlaunchintintforpackage getting package returned null
Superscalar processor design yaoyongbin Chapter 2 cache -- Excerpt from subsection 2.2
leetcode 257. Binary tree paths all paths to a binary tree (simple)
STM32开发笔记113:ADS1258驱动设计——读取温度值
完好性简要介绍
Glory earbud 3 Pro with three global first strong breakdowns flagship earphone Market
Go IO module
[Matlab]二阶节约响应
67. binary sum
Why microservices are needed
astra pro双目相机ros下启动笔记
inner join执行计划变了
[Yu Yue education] calculus of Zhejiang University in autumn and winter 2021 (I) reference materials