Transform translate unity что это
Transform.Translate
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Sumbission failed
For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Parameters
Description
If relativeTo is left out or set to Space.Self the movement is applied relative to the transform’s local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the movement is applied relative to the world coordinate system.
Parameters
Description
Moves the transform by x along the x axis, y along the y axis, and z along the z axis.
If relativeTo is left out or set to Space.Self the movement is applied relative to the transform’s local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the movement is applied relative to the world coordinate system.
Parameters
Description
The movement is applied relative to relativeTo ‘s local coordinate system. If relativeTo is null, the movement is applied relative to the world coordinate system.
Parameters
Description
Moves the transform by x along the x axis, y along the y axis, and z along the z axis.
The movement is applied relative to relativeTo ‘s local coordinate system. If relativeTo is null, the movement is applied relative to the world coordinate system.
Transform.Translate
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Declaration
Declaration
Description
If relativeTo is left out or set to Space.Self the movement is applied relative to the transform’s local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the movement is applied relative to the world coordinate system.
Declaration
Declaration
Description
Moves the transform by x along the x axis, y along the y axis, and z along the z axis.
If relativeTo is left out or set to Space.Self the movement is applied relative to the transform’s local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the movement is applied relative to the world coordinate system.
Declaration
Description
The movement is applied relative to relativeTo ‘s local coordinate system. If relativeTo is null, the movement is applied relative to the world coordinate system.
Declaration
Description
Moves the transform by x along the x axis, y along the y axis, and z along the z axis.
The movement is applied relative to relativeTo ‘s local coordinate system. If relativeTo is null, the movement is applied relative to the world coordinate system.
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Copyright ©2021 Unity Technologies. Publication Date: 2021-12-03.
Трансформации
Редактирование трансформаций
Компоненты Transform управляются в 3D пространстве по осям X, Y, и Z, или в 2D пространстве просто по X и Y. В Unity эти оси представлены красным, зелёным и синим цветами соответственно.
A transform showing the color-coding of the axes
Transform может быть изменён в окне Scene или путём изменения параметров в инспекторе. В сцене вы можете изменять Transform используя инструменты Translate, Rotate и Scale (двигать, вращать и масштабировать). Эти инструменты расположены в верхнем левом углу редактора Unity.
The View, Translate, Rotate, and Scale tools
Эти инструменты можно применить к любому объекту в сцене. Когда вы кликнете на объект, вы увидите, что у объекта появится гизмо инструмента. Вид гизмо зависит от выбранного инструмента.
Transform gizmo
When you click and drag on one of the three gizmo axes, you will notice that its color changes to yellow. As you drag the mouse, you will see the object translate, rotate, or scale along the selected axis. When you release the mouse button, the axis remains selected.
Transfrom с выделенной (жёлтой) осью X
Наследование
Вы можете создать родительский объект перетягиванием любого GameObject’а в окне Hierarchy на другой объект. Это создаст связь родительский-дочерний между двумя игровыми объектами.
Example of a Parent-Child hierarchy. GameObjects with foldout arrows to the left of their names are parents.
Учтите, что значения Transform в инспекторе для любого дочернего объекта показаны относительно значений Transform родительского объекта. Эти значения известны как локальные координаты. Возвращаясь к аналогии тела и рук, положение вашего тела может изменяться по мере ходьбы, но ваши руки будут присоединены в одном и том же месте относительно тела. Для построения сцены обычно достаточно работать с локальными координатами для дочерних объектов, но во время игрового процесса зачастую полезно найти их точное положение в мировом пространстве или их мировые координаты. API скриптинга для компонента Transform имеет отдельные настройки для локальных и мировых координат.
Проблемы производительности и ограничения неравномерного (Non-Uniform) масштабирования
Важность масштаба
Есть 3 фактора которые могут повлиять на масштаб вашего объекта:
В идеале, вам не надо настраивать параметр Scale вашего объекта в компоненте Transform. Лучшим вариантом является создание моделей реалистичного размера, таким образом, чтобы вам не пришлось менять масштаб. Следующим лучшим вариантом является настройка масштаба в настройках Import Settings импортированного меша, для конкретного меша. Некоторые оптимизации производятся на основе размера при импорте, и создание экземпляра объекта с изменённым значением масштаба может снизить производительность. Для дополнительной информации, прочитайте раздел об оптимизации масштаба на странице справки по компоненту Rigidbody.
Transform.Translate
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Sumbission failed
For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Parameters
Description
If relativeTo is left out or set to Space.Self the movement is applied relative to the transform’s local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the movement is applied relative to the world coordinate system.
Parameters
Description
Moves the transform by x along the x axis, y along the y axis, and z along the z axis.
If relativeTo is left out or set to Space.Self the movement is applied relative to the transform’s local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the movement is applied relative to the world coordinate system.
Parameters
Description
The movement is applied relative to relativeTo ‘s local coordinate system. If relativeTo is null, the movement is applied relative to the world coordinate system.
Parameters
Description
Moves the transform by x along the x axis, y along the y axis, and z along the z axis.
The movement is applied relative to relativeTo ‘s local coordinate system. If relativeTo is null, the movement is applied relative to the world coordinate system.
Transform.Translate
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
If relativeTo is left out or set to Space.Self the movement is applied relative to the transform’s local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the movement is applied relative to the world coordinate system.
Description
Moves the transform by x along the x axis, y along the y axis, and z along the z axis.
If relativeTo is left out or set to Space.Self the movement is applied relative to the transform’s local axes. (the x, y and z axes shown when selecting the object inside the Scene View.) If relativeTo is Space.World the movement is applied relative to the world coordinate system.
Description
The movement is applied relative to relativeTo ‘s local coordinate system. If relativeTo is null, the movement is applied relative to the world coordinate system.
Description
Moves the transform by x along the x axis, y along the y axis, and z along the z axis.
The movement is applied relative to relativeTo ‘s local coordinate system. If relativeTo is null, the movement is applied relative to the world coordinate system.
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Copyright © 2020 Unity Technologies. Publication Date: 2021-03-24.