Apply margin to camera and shape in SpringArm3D #89797
Open
+6
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes !76220
Currently, margin is only being used when neither a Camera3D is the SpringArm3D's child node nor when a shape has been set, which doesn't seem to align with the described behavior in the docs https://docs.godotengine.org/en/stable/classes/class_springarm3d.html#class-springarm3d-property-margin.
After this change, in addition to the scenario it currently works for, the margin value will also apply when the child node of the SpringArm3D is a Camera3D node, and it will apply when there's a shape set for SpringArm3D.
And for those who were wondering, SpringArm3D already has an if condition for handling a child node with Camera3D, so I'm just adding this application of margin there as well.
springarmmarginfix.zip