docs: note what a flipped part does to a part attachment - #254
Merged
Conversation
A flipped part's pose is a mirror, which only a negative scale can carry. With update_scale OFF — the default — the mirror never reaches the target, and flip_h leaves a 180-degree difference in orientation on top of that. Also state that get_part_transform() stays exact when flipped, as long as rotation and scale are read as a pair.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
docs/{ja,en}/workflow/usage_scripting.mddocument howSpriteStudioPartAttachment2Dcopies a part's pose — whole transform whenupdate_position/update_rotation/update_scaleare all ON, component-wise otherwise — but not what that means once the player is flipped.A flipped part's pose is a mirror, and a mirror can only be carried as a negative scale. With
update_scaleOFF, which is the default, the mirror never reaches the target, andflip_hleaves a 180-degree difference in orientation on top of that whileflip_vdoes not.Transform2Ddecomposes a mirror into a rotation plus a negative scale with the sign on the Y axis, so a horizontal mirror needs an extra half turn to fit that form and the rotation is what keeps it. Anyone attaching a muzzle or a hitbox to a character that turns around hits this on the default settings.The note also records that
get_part_transform()itself stays exact when flipped, providedget_rotation()andget_scale()are read as a pair. That is worth stating explicitly because the Unity player documents the opposite for its own API —Matrix4x4.rotationis undefined on a mirrored matrix, since a quaternion cannot represent a reflection at all. Godot'sTransform2Dcan, so the same question has opposite answers in the two players.Verified against the engine rather than reasoned about: with a part at 30 degrees,
flip_hreportsget_rotation() == 150,flip_vreports-30, both withget_scale() == (1, -1), and rotation + scale reconstruct the transform exactly in every case. Both flips together return the determinant to +1 — a real half turn, not a mirror.Documentation only. No code change, and the SDK submodule pin is untouched.
Merge order against #253 does not matter: that PR touches only
ss_player/, this one onlydocs/, and both branch from the same develop tip.