Starting from Energy Bar Toolkit 1.5.2 it is possible to attach bars to game objects that exist in the 3D space. Imagine 3D strategy game with many enemy objects. All these objects have separate health status. Players have the ability to select these object to check their damage value and decide which enemy should be attacked first.
Energy Bar Toolkit gives you tool to make this possible with little effort. It’s called Anchoring.
Anchor is nothing more and nothing less than a GameObject to which energy bar will stick. Anchor property can be found in Position & Size section of your energy bar inspector.
Setting an Anchor will set your pivot point of bar coordinate system at anchor screen position. Quite simply, this means that 0,0 will be always exactly on the object that you are anchoring to.
Additionally, next to Anchor property in your inspector, you have Anchor Camera which is the camera on which anchored object is rendered. It’s important when you’re using more than one camera because object may appear on different places on different cameras, or not appear at all.
Tips
- It’s often a good idea to anchor energy bar objects to themselves and make them children of some bigger 3D object. In this way bar position will stay relative to 3D object. This method is described in BotRun example
Example
![]() |
Launch |