- Modifié
Sprite Attacher Rotation Issue
I know there is a mix and match system which we will one day move to, but for time constraints we still need to use the legacy sprite attacher.
We have an issue where after attaching a body armor, the arm rotations get messed up.
We are doing a simple attach like this:
Shader attachmentShader = applyPMA ? Shader.Find(DefaultPMAShader) : Shader.Find(DefaultStraightAlphaShader);
attachment = applyPMA ? sprite.ToRegionAttachmentPMAClone(attachmentShader) : sprite.ToRegionAttachment(GetPageFor(sprite.texture, attachmentShader));
Do you know what is causing the arm rotations to get messed up after we apply?
The original attachment that is to be replaced might be rotated, you can have a look at the atlas .png
file.
You may want to check the original attachment rotation value programmatically and then call the ToRegionAttachment()
methods with the rotation
parameter set accordingly.
Another perhaps simpler way would be to re-export the atlas again with Pack Settings
Rotation
disabled so that all image parts are packed in their original orientation.