Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: DocEntropy on February 07, 2016, 04:33:52 AM

Title: uGUI: How can I detect if a world canvas element is out of the camera viewport?
Post by: DocEntropy on February 07, 2016, 04:33:52 AM
Hey guys,

I wonder if there is any custom action, or action that I'm missing that can help me detect if a uGUI canvas (displayed in world space) is outside the camera viewport.

Is there a way to achieve this in playmaker?

I needed to find out if my world space canvas is out of the screen so that i can move it back in the frustum (and keep it on the screen for a period of time).
Title: Re: uGUI: How can I detect if a world canvas element is out of the camera viewport?
Post by: DocEntropy on February 07, 2016, 04:55:30 AM
Actually, I think I figured it out:

I used the Is Visible in Camera Frustrum action found on Ecosystem - it required a rendered component so I added a sprite renderer component to the world space canvas - setting its color alpha to 0 so that it doesn't interfere with the rest of the setup.

Posting it here in case others need this bit of info.