-1
\$\begingroup\$

In Unity game engine and C# scripting; Is there any distinction between global space and world space? Are this two the same thing and identical or there is a distinction? I'm not confusing between local and global. The relation between local-global is the same to local-world? Can I exchange this two words (global and world) without creating confusion?

for example in the Unity manual: https://docs.unity3d.com/Manual/Transforms.html

Make a distinction adding "or":

world space or global coordinates.

\$\endgroup\$
  • 3
    \$\begingroup\$ Global/world space are the same thing. The other space is local/mode-view \$\endgroup\$ – n_plum Mar 23 '17 at 19:03
  • \$\begingroup\$ Shoot meant to say model-view not mode... And yes by extension local has the same relation to world as it does to global as they are interchangeable \$\endgroup\$ – n_plum Mar 23 '17 at 19:15
  • \$\begingroup\$ In Unity making courses I here this distinction for this particular game engine. Here is the source video at 04:02 link: 3dmotive.com/series/advanced-c-in-unity-5/291/2635. \$\endgroup\$ – Alan Mattano Mar 23 '17 at 19:15
  • 2
    \$\begingroup\$ Because it's really a generic question, not specific to Unity. \$\endgroup\$ – Vaillancourt Mar 23 '17 at 19:23
  • 1
    \$\begingroup\$ There's nothing here that is Unity specific. The terms are generic 3D terms. I think this question is better as one that doesn't bother with "Unity" in the text or title, but I'm not going to get into a rollbar war with you over it. If you want to leave it this way, that's fine. There's no reason to make two questions though. \$\endgroup\$ – user1430 Mar 23 '17 at 20:07
1
\$\begingroup\$

I think it is basically the difference between relative and absolute positions.

https://docs.unity3d.com/ScriptReference/Transform-localPosition.html

So that a child gameObject's position/rotation/scale can be relative to it's parent (0, 0 is bottom left of window not screen) instead of

https://docs.unity3d.com/ScriptReference/Transform-position.html

Which is absolute. (0, 0 is middle or bottom left of screen depending on anchors)

there is a toggle for this Local/Global setting in the toolbar too

https://docs.unity3d.com/Manual/PositioningGameObjects.html

enter image description here

Click the Local/Global button on the right to toggle between Local and Global.

  • Local keeps the Gizmo’s rotation relative to the GameObject’s.
  • Global clamps the Gizmo to world space orientation.
| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ So the gismo unity Vector3 "rotation" that is in the inspector not accessible via coding are relative global values activated via this button and the C# functions as for example InverseTransformPoint are world absolute value. \$\endgroup\$ – Alan Mattano Mar 23 '17 at 23:01
  • \$\begingroup\$ ya the button is only for editing in editor with mouse or inspector... from source code use transform.localPosition for local (usually always) and transform.position for global \$\endgroup\$ – Rakka Rage Mar 23 '17 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.