- Home /
Check if end of object reached.
How can I need to constrain movement of character to a 2dplane that changes size. In order to constrain my character inside I believe I need to get the current size of the prefab. I tried adding a Meshrenderer component to it but the size I retrieve is always 0. I should mention that the plane is imported as a fbx file.
Comment
The problem was that I was accessing the size of the parent rather than the size of the floor.
Best Answer
Answer by Yamauti · Nov 17, 2012 at 10:26 PM
you could place box colliders just on the edges of the 2dplane as children, so whenever you change the size of the parent object the colliders also resize accordingly.
this could work with regular colliders or triggers, depending on your need.