I am using Vector2 structures to track the location of a game piece as it moves between two points in space on a 2D plane.
I seem to be getting very strange values according to the debugger when I initialize my local Vectors.
I am pulling two INT values and casting them into local float variables. You can see the values of the respective floats used to initialize the Vector2 named startPosition below in the Watch tab.
Additionally, I tried using the game piece’s transform values to set a ‘current’ position of the game piece. That seems to produce a Vector2 with what I presume are initial values:
I am really confused by this. In the second example, am I getting this result because I’m leveraging a member structure (transform.position) for a local variable’s initialization?
I’m using Unity 5.9.6 on Mac OS X Sierra (ver. 10.12.4) The class that has this code in it is using the following libraries:
Any input would be greatly appreciated!
Thank you in advance,