As many have said, comments that explain why rather than what are generally a good idea. Your example is a perfect example of a comment that explains why an non-obvious bit of code exists.
If you have this exact line of code, and a copy of the comment, in multiple places, then it would make sense to make a one-liner function in order to avoid repetition.
If this one line isn't at the same conceptual level as the surrounding code, then you might also want to isolate it. For example, if the statements before and after you flip this flag are very high-level concepts, then the need to explain it with a comment might be a symptom of working at the wrong level of abstraction.
Consider this hypothetical context:
CommitRenderingContext(blah, blah, blah); PrecalculateLookUpTable(parameters); //Needs to start disabled to avoid artifacts the first frame. Will enable after frame complete. lineRenderer.enabled = false; lineRenderer.RenderFrames(frame_count);
The fact that the one-liner is the only statement in the vicinity that needs explanation is a clue that it's out of place in the context of the higher level work going on around it. Presumably, the lineRenderer will be enabled inside a loop hidden index RenderFrames, which means that the two places that twiddle this flag are not only separated by distance, but by conceptual level as well. In that case, it probably belongs inside the RenderFrames method, and the comment would likely be very appropriate there.
If, on the other hand, the context is something like:
lineRenderer.color = user_selected_color; // We use half the desired thickness because we're going to do two passes. lineRenderer.thickness = user_selected_thickness/2; //Needs to start disabled to avoid artifacts the first frame. Will enable after frame complete. lineRenderer.enabled = false; for (int i = 0; i < frame_count; ++i) { ... detailed calculations ... if (lineRenderer.enabled) { ... do something with lineRenderer ... } else { lineRenderer.enabled = true; } }
Then I wouldn't consider the comment out of place.