Can Layer Masks Achieve This Effect

Posted by Julian on Game Development See other posts from Game Development or by Julian
Published on 2014-08-22T20:18:20Z Indexed on 2014/08/22 22:35 UTC
Read the original article Hit count: 191

Filed under:
|
|
|

If you look at the image below you will see the player surrounded by a dotted yellow box.

enter image description here

The dotted yellow box is also part of the player and represented a portion of the player being masked from both rendering and affected by physics. My question is if layer masks in Unity can achieve the following effect.

-In Area 1, the red box/animations of the player are visible and the rigidbody of this shape is affected by all Physics.

-Any portion of the player that enters Area 2 makes the larger yellow box within the area become visible (and affected by physics) and vice versa for any portion of the smaller red box that enters.

-This can persist when both entering and leaving either area from any direction.

Thank you for any help!

© Game Development or respective owner

Related posts about 2d

Related posts about unity