Closed shemtomke closed 1 year ago
I changed the for loop to this and i was able to get the exact position of the anchor points
for (int i = 0; i < pathCreator[currentPathCreator].bezierPath.NumAnchorPoints; i++)
{
Debug.Log("POINT " + i + " : " + pathCreator[currentPathCreator].bezierPath.GetPoint(i*3));
}
The GetPoint method takes the i and multiplied by 3 because for each two anchor points holds the position of 2 control points in between. When we start from 0 as an anchor index we are able to get the the second index (1) from the difference of 2 control points in between. So essentially is 0*3 to get second Anchor index.
using this set of code i get different positions as per the anchor points in the path creator: (I used NumAnchorPoints)
From the Highlighted Point we see it does not match the anchor point (Anchor Index 1) vector 3 position. This is also an issues to other points in the path.
They do not match at all! DEBUG LOG MESSAGE FOR ANCHOR POINT 1 - POINT 1 : (-8.31, -4.47, 0.00) INSPECTOR PATH CREATOR ANCHOR POINT 1 - (-7.691796, -4.233789, 0)
I noticed some of the values fetched/debugged are from the control points rather from the anchor points. This was with the help of this code to verify. (I used NumPoints)
How do I go about this issue?