Place a quad based on a corner


I have multiple targets in a 3D game. I would like to place a health bar on each target.

The way I am doing this is by placing a quad on a “hud camera” and changing its local scale to reflect the health level.

All this works but as a quad transform.position is based upon the quad mid point - the quad expands left and right when what I would prefer is that it grows in one direction only.

Is there anyway to set the base the quad position on say top left and not center?

Thanks in advance.

Two solutions. You can use the CreatePlane Editor Script from the Unity Wiki. This script will allow you to create a Quad with the anchor where you want it. Second solution is to place an empty game object on the edge you want to expand from, and make the visible game object the child. The sizing code goes on the empty game object.