In the project I'm working on, gameplay areas are represented by 2d "Lanes" the player can move in. I have a tool script that can regenerate the lane after its size or other parameters have changed. When it does this it modifies the size of its CollisionShape2D (the Lane extends Area2D). For example I have a Lane in the world that has a length of 3000 and a rectangular collision shape to match, but when running the game, the size of that very collision shape is back to its default width of 1500.
pic 1 shows the editor where the lane is accurately sized after running its @tool script
pic 2 shows it undersized back to its default in game.
I know I can work around this by running the resizing/regenerating code on _ready or something, but I am worried in the long run about having to do that for every lane (and other level objects that might end up having the same problem), especially when those values are already set in the editor, making it seem redundant to have to rerun those modifying functions.
Is there any way to ensure that those values stay changed?