Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply margin to camera and shape in SpringArm3D #89797

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Chronos-W
Copy link
Contributor

@Chronos-W Chronos-W commented Mar 23, 2024

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

  • Three SpringArm3D nodes: one with Camera3D as child node, one that uses SpringArm3D's shape, and one that does neither of the previous two so it uses a raycast. Margin should apply to all three.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SpringArm3D's margin not used for Camera3D
2 participants