## Viewing post in Code for image_angle/x/yscale?

Hey Matharoo,

Sorry I didn't respond until now. It was going to be difficult to send you the project as it currently is, I load alot of json files from the filesystem and the code that calculates the attach_point is buried below a good number of inheritance that would've taken just as long to explain hah. But I figured it out. I just had to think it through procedurally. I have sprites that I flip the image_xscale , image_yscale, and image_angle after that so I just needed to process it in order.

Here's the code in case you are interested!

In essence I get the current image_index, then calculate what the attach_point would be considering ONLY image_xscale and image_yscale, which isn't too bad. Then after that's all done I calculate the image_angle. What was throwing me off is that once you flip the image on the x or y axis, it also flips the attach_point direction the opposite way. So the code I had was already correct, it just wasn't the result I expected.

Thank you for replying so quickly though, I appreciate your willingness to help! I appreciate your videos!

var _curr_index = floor(image_index);

if (_curr_index >= array_length_1d(_attach_points)) {
_curr_index = array_length_1d(_attach_points) - 1;
} else if (_curr_index < 0) {
_curr_index = 0;
}

var _curr_attach_point = _attach_points[_curr_index];

_offset_x = _curr_attach_point[0];
_offset_y = _curr_attach_point[1];
_attach_point_direction = _curr_attach_point[2];

// **************************************
// **************************************
#region Calculates x/y coordinate and direction of attach point assuming image_angle = 0
// Normal direction
if (image_xscale > 0 && image_yscale > 0) {

// Flipped horizontally
} else if (image_xscale < 0 && image_yscale > 0) {

} else if (image_xscale > 0 && image_yscale < 0) {

} else if (image_xscale < 0 && image_yscale < 0) {
}

#endregion
// **************************************
// **************************************

// **************************************
// **************************************
#region Calculate x/y/direction taking image_angle into account
if (image_angle != 0) {
// Gets angle of the straight line drawn from center of player object to attach point

// Once starting direction is determined, calculate adjusted based on image_angle

// Get length of line from center of player object to attach point

// Gets new x/y coordinates of new attach_point angle when you add in image_angle

// Finally, add direction of actual attach point to new calculated direction
} else {
_attach_point_direction_from_center = "N/A";
_length = "N/A";