Answers for "Help understanding transform"
http://answers.unity.com/questions/670719/help-understanding-transform.html
The latest answers for the question "Help understanding transform"Answer by robertbu
http://answers.unity.com/answers/670733/view.html
Imagine a cube with a rotation of (0,0,0). Imagine an arrow sticking out the right side of that cube. 'transform.right' is the direction of that arrow in world space no matter how the cube is turned or twisted.
Mathf.Atan2() generates an angle given an x and a y. It is a bit confusing, but the standard way to use this function is Atan2(y, x). That is, the 'y' value is the first parameter. It returns an angle in radians. The angle starts on the right an proceeds counter clockwise.
The use of 'transform.right' is pretty typical in 2D games since the objects rotate around their 'z' axis. The line of code above figures out the angle the object has been turned around the 'z' axis and subtracts it from 'baseAngle'.Sat, 22 Mar 2014 23:39:17 GMTrobertbu