mob-sakai/UnmaskForUGUI

The ray Passes through the unmasked rectangle. Not work for Canvas render mode :Screen Space -Camera

Closed this issue · 10 comments

In my case ,my canvas was setting to Screen Space -camera,and then,the UnmaskRaycastFilter componet didn't work,The ray can not Passes through the unmasked rectangle.

Environment (please complete the following information):

  • Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL]
  • Unity: [e.g. 2018.4.0f1]
  • UnmaskForUGUI: [e.g. v1.0.0]

Same here, you can use Screen Space - Overlay for an alternative

Hi @mcaisw @harunuysali07

Thank you for your reporting!

I also ran into this issue recently when attempting to add 3D VFX to a 2D UI.

If you switched to "Screen Space - Camera" for a similar use case, you can instead use "Overlay" in conjunction with another awesome package from @mob-sakai (see: https://github.com/mob-sakai/ParticleEffectForUGUI).

This issue will be fixed in next version!

T--T commented

add a parameter on the RectTransformUtility.RectangleContainsScreenPoint() can fix this problem

UnmaskRaycastFilter.cs -> public bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera)

return !RectTransformUtility.RectangleContainsScreenPoint((m_TargetUnmask.transform as RectTransform), sp, eventCamera);

T--T commented

But it's still not right in release v1.1.3 @mob-sakai

@T--T

Thank you for your information!

@mob-sakai Can you make upm version with this fix, please?
P.S. Thank you for this asset

Fixed in v1.2.0.