# Warp GameObject Size When Entering/Leaving Area

Below I have an image describing the desired functionality I am going for. Let's say you control a square and when you move this square into a given area, any part of your rigidbody/model inside of the area will be magnified upon entering and shrunk upon leaving. So now you more or less are made up of two rectangles, one small and one large.

What would be an elegant approach towards achieving this effect?

• Are you using Unity? – Selali Adobor Aug 16 '14 at 4:29
• @TrevorPowell I have not implemented anything yet because I was afraid my approach would be overkill. I was initially going to have the object's transform be reinstantiated on every update based on where the intersection of the player and the area was. So initially we are made up of one rectangle and then right when we enter the rectangle, we destroy that initial rectangle and make our new object be comprised of a smaller rect representing the left side and a larger rect representing the part that has entered the "magnification zone". – Julian Aug 18 '14 at 14:38
• @AssortedTrailmix Yes I am using Unity. – Julian Aug 18 '14 at 14:38
• Then using multiple gameobjects with physics will be impractical Use the camera approach, possibly with an image effect to further the illusion of a "magnifying glass" – Selali Adobor Aug 18 '14 at 14:44
• I like the idea. However, for my needs I think it may be too limited. The game is multiplayer and in some cases, one player walking into the zone will only cause him to grow in size while the other player walking into the zone will not do the same. Essentially, this transformation is not an illusion but actually happening in the world. – Julian Aug 18 '14 at 15:03

if(magnificationCameraGO.IsVisible)