I've read on the documentation and gone through google but my question is in terms of coding, when do I use this?
When do I need to worry about this? Such as if I'm using mouse look script, and i shoot, it dosen't shoot from whre the mouse is looking straight but now it's shooting from the side.
Any advice, thanks.
Also does anyone have a good explanation for local vs global space?
Answer by Chris Masterton
Oct 23, 2010 at 04:21 AM
I'll try to explain local vs world in 2d and without rotation (because its hard to draw in ascii!)
When we say "this is the position of A in the world" - we are talking about the position of A relative to the world origin. The origin is 0, 0 and where the x & y axis meet. Below shows us A, B & C in WORLD space.
+3 | B
+1 | C
Imagine A (0, 4) is an alien, B (7, 3) is a Boss monster and C (3, 1) is our hero - Chris.
When we talk about local space we have to ask - local to what? To translate the world space into Chris' local space we put Chris at the center of the universe. And now in Chris's local space the it looks like.
+3 A |
+2 | B
Long winded way of saying everything is relative - in world space its some arbitrary origin offset. In our local space example the world literally rotates and moves around Chris.
Answer by Jessy
Oct 23, 2010 at 02:46 AM
There is a button in the upper left of the Editor that lets you switch between the two, in terms of tool handles. Start rotating any object by dragging left and right over X, Y, or Z in the object's Transform component, while making sure the "Move" icon is selected, in the very upper-left of the Editor (it's next to the hand tool). Notice how the tool handles rotate, when you're viewing Local space handles, but stay fixed, when you're viewing Global space handles.
Unity has the concept of "world" space. But every object that you create has its own space, and they very often will not match up. Imagine the way whatever building you live in stays at a "fixed rotation", but you can turn around, within it. So, for example, when you're lying down, your own Y axis is aligned with the "world's" X-Z plane, not its Y axis.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
To help users post good questions and use the site effectively we have posted a user guide. Please check it out.
Answers and Comments
No one has followed this question yet.
Global and Local(newbie)
Set a sun light (Day Night Cycle)
Question about finding out edges of a box collider
How to manage a round based game?
WorldSpace vs LocalSpace problem