Hi there, I am trying to mask my image. It works in the Editor but not in the build.
Also, the Y position does not match, and I have to offset the Z position for each element inside the canvas; otherwise, it shows weird flickering at runtime.
Based on your issue with the UI mask functioning correctly in the editor but not in the build, there are a couple of things you might want to check:
Masking Component Behavior: Make sure the scaling is consistent across different environments. The line this.uiObject.scale.y *= -1; in the onAfterCreated method of the MaskableGraphic class can cause flipping behaviors that might depend on environment settings when rendering in the build versus the editor environment (see the documentation).
Graphic Component: Check the setTexture method in the Graphic class to ensure that any texture flipping is set up consistently between the editor and build versions. There is a logic that could affect how textures are set during the runtime, especially concerning the texture’s color space (see the documentation).
RectTransform Settings: Verify your RectTransform settings to ensure they are appropriately set both in the Editor and the build. This would include confirming proper anchoring and pivot settings, which can affect the vertical position of your elements (see the documentation).
Since you mentioned that the Y position is mismatched, you should review how the anchoredPosition property is being set or adjusted during scenes in both environments. It’s also worthwhile to ensure no unintended offsets or transformations are applied based on the canvas settings in the build.
You might also want to confirm the settings used for the Built-in pipeline, including render settings. Sometimes discrepancies arise due to graphics APIs or shader compilations in the build versus what is utilized in the Editor.
If the issue persists, please provide logging from the build to identify potential discrepancies further.
Let me know if you’ll need more specific information related to any of these suggestions!
1 replies left - Get a PRO license for more AI replies. thread_BwjHBvwiQwMoZcdSpwt5gnup Reply to this message to continue the conversation