- Home /
How can a Plane act as a footprint to a parent object?
I have to "fake" a shadow under an object that has no surface underneath it to receive a shadow. I'm using a plane to hold a texture with a dark translucent image. I can assemble this fine in Unity, but I need to do so programatically for parent objects of various widths.
I have a Text component that uses CreatePrimitive() in Start() to create the Plane, and I link it to the parent object (i.e. the text from FlyingText3D highlighted below) with this.shadowPlane.transform.parent = transform; and have linked rotation with this.shadowPlane.transform.localRotation = Quaternion.identity; but cannot seem to simply get the scale of the plane to match the localScale "footprint" of the parent game object.
How should I go about creating/instantiating this new Plane so that it's always under the text GameObject? The text/plane will only ever rotate on the y axis. The text scale can be changed during runtime, as well.