SOLVED stopping animation at the last frame

this is what my current code looks like:

if (image_index == 510)
{
image_speed == 0; (error message is appearing on this line)
}

im not sure what im doing wrong but the error message says: unnecessary expression image_speed used as a statement
 

sp202

Member
That's a dangerous way of checking the image_index as if you've an image_speed less than 1 then it's likely that won't ever be true. I suggest using round(image_index)==510.
 
That's a dangerous way of checking the image_index as if you've an image_speed less than 1 then it's likely that won't ever be true. I suggest using round(image_index)==510.
Yep, true. I should've mentioned that, too. I'd use if (image_index >= 510) here. Never use == unless you actually want to check whether a value EXACTLY equals something. Almost all of my comparisons are <= or >=
 
Top