In the code below, what values are the first two variables being set to, and why?
This code is attached to the main character in the Unity 2D side scroller tutorial. For the purposes of this question assume the following Vector3 values:
Active Platform: (2,1,0)
Player: (1,2,0) The player is standing just on the edge of the platform, therefore his x coordinate is slightly off.
var newGlobalPlatformPoint = activePlatform.TransformPoint(activeLocalPlatformPoint);
activeLocalPlatformPoint = activePlatform.InverseTransformPoint (transform.position);
activeGlobalPlatformPoint = transform.position;
var moveDistance = (newGlobalPlatformPoint - activeGlobalPlatformPoint);
transform.position = transform.position + moveDistance;