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?
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.
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.
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.
answered Oct 23 '10 at 04:21 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.
answered Oct 23 '10 at 02:46 AM