public class Level : Node2D
public int FinishPosition;
public override void _Draw()
DrawRect(new Rect2(0, -540, FinishPosition, 1080), Color.Color8(255, 0, 0), false);
The code above draws a red rectangle in editor. The rectangle is as wide as FinishPosition script variable. It works fine, however after FinishPosition is updated I have to close and reopen the scene to reflect the changes and actually resize the rectangle.
So I would like to ask you, is there a way to "refresh" the rectangle right after the FinishPosition is updated in inspector without need for reopening the scene?