Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Energy Bar Toolkit - 2D and 3D Progress Bars

Discussion in 'Assets and Asset Store' started by genail, Mar 30, 2013.

  1. leonalchemist

    leonalchemist

    Joined:
    Jul 9, 2012
    Posts:
    8
    might be a bit much to answer but i was trying to set this up for a network FPS game; how would you handle everyone having their own Health bars and such. I'm using javascript and I already have the code working and showing the health variable on screen, the only issue is that none of my GUI element from this toolkit are showing when game is built; works in the editor though for some reason.
    Any kind of help or hint on what to look at would be nice
     
  2. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hi leonalchemist!
    Thank you for buying EBT! Are you are set to deferred lighting by any chance?
     
  3. leonalchemist

    leonalchemist

    Joined:
    Jul 9, 2012
    Posts:
    8
    lol, that was a quick and simple fix :)
    still fairly noob on rendering path and such, all i know is rendering path is faster and probably better which i might use later on; is there future plan/work-around this for the people who wants to use this(maybe 2 cameras?.. hope im not answering my own question)
    thx again
     
  4. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    I've attached short instruction in PDF how to use EBT with deferred lighting that I've wrote lately. It will be available in the official documentation shortly ;-)
     

    Attached Files:

  5. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    @imtrobin I've found the issue. Let me know how fast do you need this issue to be fixed for you.
     
  6. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Yesterday :) If I can get it fast, thanks.
     
  7. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    No problem, I will send you the package in a today, because I have some troubles with using my microwave time machine ;-)
     
  8. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    @rocki, @imtrobin, @LeeAllen
    I'm now looking into Daikon Forge. I am truly amazed how well-designed and powerful this toolkit is! I will be working with the integration this week, and I want you to know what to expect. I am at the planing stage, and I am open to discussions ;-)

    How it will work:
    - DF EBT Anchor component will be available in the Daikon Forge components menu
    - Creating an anchor will display nothing, and...
    - You need to initialize Energy Bar Toolkit, create mesh renderer of choice, and select this bar in the DF EBT Anchor object
    - The bar will jump into DF GUI and can be scaled and positioned similar to other DF components

    What will not work:
    - You wouldn't be able to put progress bar between two DF GUI components in Z axis. This means that EBT progress bar can be only on top or on the bottom
    - You cannot use clipping ability. For instance your bar won't be able exist on scrollable list.
     
  9. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Released: Energy Bar Toolkit 1.7.1 with Daikon Forge support

    Energy Bar Toolkit 1.7.1 is out, and the big news is that it gets Daikon Forge support!

    Daikon Forge Support

    Daikon Forge GUI is a new GUI toolkit that caused a lot of stir in the Unity Asset Store. With relatively short amount of time it took NGUI position of most profitable asset, and there's no surprise about that - DF-GUI is simply great!

    There were voices that Energy Bar Toolkit should support DF-GUI. We listened, and here it is!

    Read how to use Daikon Forge integration here.

    GC Activity Optimization
    One of our users (hello imtrobin!) have noticed that filled renderers are causing quite big GC overhead. In 1.7.1 number of allocations were reduced about 4 times.

    Fixed Unity 3.4.0 inspector GUI
    Unity 4.3 introduced a lot of changes, but not without any negative consequences. We've fixed inspector GUI rendering in 4.3.

    What's next?
    • We're planing to transfer remaining 3 renderers to 3D space. This should be done before 1.8.0 will be released.
    • There was a request for a new effect - to put sprite at the end of progress bar.
    • Multi-resolution support will be improved for GUI renderers.
    • Support for atlases to reduce draw calls to minimum.
    Have a feature request?
    Then write anytime to support@madpixelmachine.com!

     
  10. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Thanks Big Time for the new Release and Daikon Support. You Guys are Awesome.

    Cheers.
     
  11. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    I also want to thank you for including DF-GUI support. Great job!
     
  12. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hey, no problem! ;-) One thing: this integration works for mesh renderers only, but in 1.7.x line all OnGUI renderers will have mesh versions too.
     
  13. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Hi,

    Just unpacked the Daikon Forge package with a fresh import of EBT and am getting the 3 errors below. This is with the latest EBT(1.7.2) and latest DF-GUI (1.0.12):

    Assets/Energy Bar Toolkit Daikon Forge/EnergyBarToolkitDFAnchor.cs(40,38): error CS1061: Type `EnergyBarBase' does not contain a definition for `DrawAreaRect' and no extension method `DrawAreaRect' of type `EnergyBarBase' could be found (are you missing a using directive or an assembly reference?)

    Assets/Energy Bar Toolkit Daikon Forge/EnergyBarToolkitDFAnchor.cs(42,30): error CS1061: Type `object' does not contain a definition for `width' and no extension method `width' of type `object' could be found (are you missing a using directive or an assembly reference?)

    Assets/Energy Bar Toolkit Daikon Forge/EnergyBarToolkitDFAnchor.cs(43,31): error CS1061: Type `object' does not contain a definition for `height' and no extension method `height' of type `object' could be found (are you missing a using directive or an assembly reference?)



    This is not important, but I'm also getting this warning on a fresh import of EBT using Unity 4.3.1:

    Assets/Energy Bar Toolkit/Scripts/Editor/EnergyBarInspectorBase.cs(384,14): warning CS0618: `UnityEditor.Undo.RegisterSceneUndo(string)' is obsolete: `Use DestroyObjectImmediate, RegisterCreatedObjectUndo or RegisterUndo instead.'

    Thanks.
     
  14. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Korindian,

    Thank you for noticing this! I am looking at my GIT history for about 40 minutes now, and I am still confused how I've managed to include this package from newer version and put it in the old one (master version landed in 1.7.2).

    Please apply this package into your project: https://www.dropbox.com/s/gjz6dw83qosizvx/EnergyBarToolkitDF-GUI-fix1.unitypackage

    This bug above and the warning will be fixed in 1.7.3.
     
  15. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
  16. free_space

    free_space

    Joined:
    Jan 10, 2014
    Posts:
    1
    Hey Genail,
    I'm having a problem keeping the energy bar in the right position when the camera zooms in and out, I'm wondering if you have any suggestions.

    My scene has 1 orthographic camera, and a gameobject(a sprite) with the energy bar placed right below it. The energy bar has the gameobject as its anchor. The positioning stays perfect as I move the camera or the gameobject left /right / up / down, but if I zoom in or out (by changing the camera's size value) the bar will lose its place.

    Any ideas?
     
  17. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello free_space,

    Thank you for purchasing Energy Bar Toolkit!
    Anchoring bar to object will always keep constant relative distance to this object (in pixels). This means that if your bar (for instance) is [0, 50] pixels away from game object, it will always stay that way. Is this the case? If not, please send me an unitypackage including a scene with that issue to support@madpixelmachine.com .

    Cheers!
     
  18. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Hi Genail,

    I've been playing around with the latest version of EBT and have a few questions:

    1. I'm still getting the warning on a fresh import of 1.7.3:

    Assets/Energy Bar Toolkit/Scripts/Editor/EnergyBarInspectorBase.cs(384,14): warning CS0618: `UnityEditor.Undo.RegisterSceneUndo(string)' is obsolete: `Use DestroyObjectImmediate, RegisterCreatedObjectUndo or RegisterUndo instead.'


    2. While following your documentation on adding a filled mesh renderer to DF-GUI, I was getting some errors about Transform.localScale when dragging the filled energy bar to the EBT DF-GUI DFAnchor slot. Sorry I don't have the exact error messages, but it kept saying something about NaN and infinity. When this happens again I'll post the exact message.

    3. Do you have a general time frame as to when the repeat, sequence, and transform renderers (using the mesh renderer) will be available?

    4. In your Playmaker action packages, would it be possible to add "Every Frame" checkboxes to your actions? One energy bar I was creating wasn't filling up and I realized it was because of a lack of updating every frame.

    5. Is there a way to assign min/max values for a bar as raw floats directly, not just as a percentage?

    6. When using the DF-GUI integration, do the options on the Energy Bar Toolkit GameObject (created by the init tool) have any effect? Namely fixed size, pixel perfect, etc.

    7. If I'm dynamically instantiating prefabs with energy bars anchored to them (using mesh renderers), what is the best way to achieve this? For example, would I need to programmatically add mesh renderers as children of anchors in the EBT panel, and then somehow set the anchors? How would I change the anchor mode, position, anchor object/camera etc. through code?

    Thanks in advance!
     
  19. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Korindian!
    Wow, that's a lot of things you've pointed me here! Let's start from the beginning...

    I'm sorry, I've forgot about that. I won't release 1.7.4, because 1.8.0 is ready and it's now going through testing stage (it fixes the problem). You can fix this easily. Please replace the line that shows the warning with this:

    Code (csharp):
    1. MadUndo.LegacyRegisterSceneUndo("Create Anchor");
    Please do. 1.8.0 may fix this issue though. I've greatly improved DF-GUI integration :)

    Repeated will be available within a week in 1.8.0. Sequence and Transform in 1.9.0. I'm starting an early-access program for those, who want access to newest features, risking installing newest untested EBT version. Do you want to participate? If so, please register on our redmine and let me know about it: http://redmine.madpixelmachine.com/

    I will look into it in a moment...

    Yes, it is. Please use EnergyBar object:
    Code (csharp):
    1. EnergyBar bar = object.GetComponent<EnergyBar>();
    2. bar.valueMin = 0;
    3. bar.valueMax = 10;
    Some of them are overridden by DF-GUI settings. 1.8.0 integration will move EBT inspector right into DF-GUI widget. Please look at this screenshot to know what can be changed: http://i.imgur.com/gohj9Ju.png

    I'm not sure if I understand this. The easiest way to access the anchor having reference to mesh bar object is:
    Code (csharp):
    1. var anchor = MadTransform.FindParent<MadAnchor>(bar.transform, 1);
    And here you can find MadAnchor API reference: http://madlevelmanager.madpixelmach...i/class_mad_level_manager_1_1_mad_anchor.html

    Please let me know if you have more questions!
     
  20. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
  21. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Hi Genail, thanks for responding so quickly and thoroughly. To respond:

    No problem, I understand it's only a warning and wanted to point it out in case you hadn't noticed. I won't post about any more warnings and errors until using 1.8.0 :)

    Great to see they'll be included in upcoming versions. I won't be using EBT for the current project but will be using it a lot in the next project. I'll look into participating then if the need arises, thank you.


    Won't the values still be integers though? My question was about setting the values using floats (other than just as percentages 0.0 to 1.0 using Valuef), for example:
    Code (csharp):
    1.  
    2. bar.valueMin = 0.0f;
    3. bar.valueMax = 123.1234f;
    4.  
    I can convert to int or use the percentages, but was just wondering about directly using floats.


    Looks great and a lot more intuitive. It's good to know you're continuing to work on DF-GUI integration. In your documentation will you be able to include what exactly is not being used and what is overridden?

    Thanks. I'll use this when I get to my next project. To clarify, I mean instantiating objects with mesh bars after scene loading and during gameplay. Since the mesh bars are not attached to the game object itself (like OnGUI bars) but to the Energy Bar Toolkit game object (created by the init tool), I'll have to also create the bars during gameplay (and set some properties) and set it as a child to the game object created by the init tool, correct?

    Yup that's exactly what I was looking for. Thanks!

    I'll be giving you 5 stars for your product and support :D

    Edit: Forgot to add, would it be possible for the DF-GUI and Playmaker packages to open within the same folder as the main Energy Bar Toolkit folder for organization? I can do it myself of course, but it would save some time having to do it for each version released. Thanks again for your fast response.
     
    Last edited: Jan 15, 2014
  22. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Yes, these are integers. I'm not using floats here because of easier stepping. You can do as the following:
    Code (csharp):
    1. float valMin = 0.123;
    2. float valMax = 2.345;
    3. bar.valueMin = valMin * 1000;
    4. bar.valueMax = valMax * 1000;
    5. bar.valueCurrent = 1.5 * 1000;
    Will do! For now all that is visible on this screenshot is usable :)

    Yes, that is correct. All mesh bars must be located under the Panel object. I will change that requirement, because it is a pain in the ass!

    Thank you! :)

    I shouldn't change the location now, because it will affect many of EBT users. Please enable meta files in your project. This will help Unity to track files that already are present in your project, and they will be updated no matter where they are located.

    Cheers!
     
  23. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    584
    Ah that makes sense. I'll do that if I'm using floats, otherwise it looks like integers (the way you do it) looks the best way to go.

    Ok no problem. I already have to have meta files enabled because I'm using version control. Looking forward to your future releases!
     
  24. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Release: Energy Bar Toolkit 1.8.0 is out!

    After more than 2 months of development Energy Bar Toolkit 1.8.0 is finally out! Here's what changed!


    New Features

    New Mesh Renderer: Repeated
    Energy Bar Toolkit is continuing its journey towards rendering using meshes. In 1.8.0 release you're able to use repeated mesh bars.


    Mesh Renderers: Pivot points for labels
    Because of many user requests, we've added pivot points for labels. Now your label will align to a given pivot point, which makes EBT labels more useful than before.


    NGUI: New integration method
    NGUI integration for Energy Bar Toolkit was always falling behind if we're looking at the feature list. In 1.8.0 old NGUI integration has been marked as deprecated, and the new one is taking its place. The main difference is that it is using Mesh Renderers, which are much easier to maintain. Of course this change has its drawbacks about which you can read in the NGUI integration tutorial.


    Mesh renderers filled new effect: sprite follow
    Now you can easily setup the object to follow the tip of filling bar. Check out this cool effect!



    Improvements

    Much better multi-resolution support
    OnGUI bars received better multi-resolution support. You're now able to set the resize mode to:
    • Fixed - will keep constant size in pixels
    • Stretch (formerly normalized)
    • Keep ratio - resize but width/height ratio will be still intact

    Bug Fixes
    • DF-GUI: Fixed bars rotation
    • Mesh Renderers: Radial CCW fill direction is now working as expected


     
  25. Fritsl

    Fritsl

    Joined:
    Mar 10, 2013
    Posts:
    211
    I just purchased this, and though 1.8.0 is what I got, the manual is apparently for an older version. It's rather confusing/useless ;/
     
  26. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Fritsl,
    Thank you for purchasing EBT!

    Have I accidentally forgot to pack new version of documentation? There may be places, where some new functions are not documented, or something is documented wrong. If this occurs, please report it back to me. For the latest, and greatest docs please go to http://docs.madpixelmachine.com/energybartoolkit/doc/latest/ .

    Cheers!
     
  27. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    I'm currently away from home until Monday, but if you found something missing, please let me know, and it will update it as soon as possible.
     
  28. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Update: Energy Bar Toolkit 1.8.1 has been released!

    The first bugfix release for 1.8.x line is out. Here you can read what has been changed.

    New feature: pivots for OnGUI labels

    OnGUI bars are still the most commonly used bars. With this release we’re introducing pivots for OnGUI labels. With this feature you can freely set labels aligment, which makes label feature a lot more useful than before.

    Bug fix: wrong Transform Renderer size calculation

    There was a bug when calculating the size for Transform Renderer which caused it to disappear or threw some nasty error into the console.

     
  29. ojuzu

    ojuzu

    Joined:
    Jun 29, 2006
    Posts:
    67
    Hi there. I'm having some issues integrating EBT with NGUI.

    I have two NGUI UIPanels and every time I create a new Energy Bar Anchor it adds it to the NGUI UIPanel I don't want it in. No problem right? I just put it in the other UIPanel that I do want it in. Everything looks good in the hierarchy but when I test it, the energy bar is displaying when the wrong UIPanel is active and it's not displaying when the UIPanel (of which it is a child) is displaying. It's like it's getting "stuck" as part of the first panel. Does that make sense?

    I haven't had time to look at your code so I'm not sure if it's something you're doing or if I'm doing something wrong. Thanks for any help you can offer!

    Dennis
     
  30. ojuzu

    ojuzu

    Joined:
    Jun 29, 2006
    Posts:
    67
    Ok, I was able to solve this issue by tweaking the CreateNGUIBar() method to hard code adding the new anchor to the correct panel instead of it just picking the first panel it found.

    Now I'm having an issue with saving out prefabs. It's kind of a unique case so there might not be an easy way around it. But what I'm doing is adding an energy bar anchor to an NGUI button (I need a health bar within a button that will be dragged around) and then I'm creating a prefab of that object. However I'm getting some serialization errors.

    The thing I'm trying to do is instantiate the NGUI button at runtime along with the associated filled renderer that the energy bar anchor is referring to. This is throwing some null reference errors so I'm wondering what you would suggest as the best approach. Any ideas?

    On an unrelated note, I've been having some issues with attaching health bars to 3D objects. Is there a way to do it through NGUI or do I need to do it with a mesh renderer now? The old bot run example on your site doesn't seem like it applies to the new NGUI approach you're using.

    Thanks!

    Dennis
     
  31. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,314
    Hello, i am a bit unconfortable with the new update and NGUi integration:
    before we could use sprites from ngui atlas, now its only a GUI Texture: its me or i cant find a way?
    it create some energybar manager out of the GUI with a new camera , before we could directly use our NGUI object structure without adding a new camera
     
  32. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Dennis, thank you for writing!
    Good to hear that you've solved it! NGUI integration is still under development, mostly driven by customer opinions. I will add this feature in the next version too.

    That's because an anchor is not the really energy bar object. You're not the first person to report this issue, so it feels now very important to change this behavior.



    To make it work normally you would need to intantiate the bar object first (1) and then the anchor object (2).

    Will you mind if I try to fix this in the next few days? I'm off until Sunday, but it shouldn't take me too long.

    Whoa! I see that NGUI anchoring has been changed. It's totally OK to setup anchoring using NGUI, but I'm a little surprised because for NGUI integration I don't use my anchoring code and I let NGUI to handle it. Please let me know if you're able to handle this. If not, I will write back after Sunday ;-)

    Cheers!
    Piotr
     
  33. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Changchun, thank you for writing!

    For the new NGUI integration you cannot use NGUI camera. I'm hoping that the camera thing is not an issue for you? This may look a little more complicated, but it's really easy to use! Still I am working on this to be more user-friendly than it is right now.

    Why I've made that decision? There were two reasons:
    1) Bars code on NGUI was mostly independent piece of work, which could be simply a brand new asset. Having bars that doesn't use NGUI and bars that are NGUI widgets caused about twice of work that I have now. Because of that NGUI bars was falling behind comparing to primary bars, and feature requests caused primary bars features to be delayed.
    2) NGUI API is changing too often. There were a times when each NGUI update broke my integration package. I had to maintain multiple integration versions for users who are using different NGUI versions. There's no simple way to get other version of asset than the newest one, so this is a big issue. The best way around this is to use NGUI API as rarely as possible.

    If you're worrying about draw calls, please look at this preview of Energy Bar Toolkit 2.0. Do you see number of draw calls? ;-)



    Cheers!
    Piotr
     
  34. ojuzu

    ojuzu

    Joined:
    Jun 29, 2006
    Posts:
    67
    That's good news! I was just about to write to say that if some type of automatic atlasing could happen with EBT then a lot of the NGUI integration would be unnecessary, or at least not as critical. Since my primary use of EBT is for unit health bars, I don't care about NGUI for that, all I care about is draw calls. So if you can get that down to 1-3 calls for all of my health bars then sign me up! Obviously, NGUI integration is still important but it would be nice to not have to bother with it for unit health bars.

    Any ETA on 2.0?

    And thanks for the clarification on my earlier questions. I'll look into them today and let you know if I have any problems.

    Thanks!

    Dennis
     
  35. ojuzu

    ojuzu

    Joined:
    Jun 29, 2006
    Posts:
    67
    I've tried using this approach and the problem I'm having is that when I convert the filled renderer to a prefab it seems to completely break. So when I instantiate it, it's no longer recognized as valid EnergyBar object. Same goes for the NGUI EBT anchor.

    If you're able to fix this issue that would be awesome. Right now, it's seems to be impossible to dynamically instantiate any EBT related object at runtime and that's a pretty big limitation.

    Thanks for your responsiveness, Piotr!

    Dennis
     
  36. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    I'm back home now. I will look into it today ;-)
     
  37. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    @ojuzu

    I've sent you a PM. I have created something that allow to create mesh bars anywhere in the Hierarchy. This one will be introduced in EBT 2.0.0 (next release).
     
  38. Pauloxande

    Pauloxande

    Joined:
    Feb 8, 2014
    Posts:
    110
    Friend do you know how to subtract the energy function with the "prefab realist"
    look $Imagem.png
     
  39. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Pauloxande!

    Are you talking about this assets? https://www.assetstore.unity3d.com/#/content/7739

    I don't know :) I don't see any documentation link. But if you manage to find out the player health value, then you can easily use it to change the bar value. Here's how to do it:

    http://energybartoolkit.madpixelmachine.com/doc/1.8.1/scripting/basics.html

    If you're not familiar with scripting, then you can try with the PlayMaker:
    http://energybartoolkit.madpixelmachine.com/doc/1.8.1/scripting/playmaker_support.html

    I hope that helps!

    Cheers!
    Piotr
     
  40. Juntaou

    Juntaou

    Joined:
    Apr 7, 2010
    Posts:
    25
    Hi I purchased your toolkit a while ago but really just barely got into using it. It looks very promising, but I'm having an issue getting a health bar to follow units correctly. I currently have the health bar attached to a unit with the anchor pointing to the head of the unit. The problem is that depending on the camera angle the health bar will appear to move away from the anchor. For example if the unit is centered on the screen the health bar will be in the correct position, however when that unit moves to the edge of the screen the health bar will be positioned way off of where it should be. Any thoughts on what I'm doing wrong?
     
  41. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello Juntaou,
    Thank you for purchasing Energy Bar Toolkit!

    Please check these things:
    • Do you use multiple cameras? If you do, please set the camera that the object is rendered on to the "Anchor Camera" field.
    • Do you attach to object that its pivot point is away from its head? Please remember that energy bar toolkit coordinates are screen coordinates (gui bars) or virtual screen coordinates (mesh bars). The best approach here is to create a new empty object, set it exactly in the place when you want your bar to be, and set the bar position x and y to 0.

    Here's the example. For object like this:
    $obj_anchor_example.png

    You should attach it to the empty that is visible here as yellow point:
    $obj_anchor_example_editor.png

    Please let me know if this helps! If not, the screenshot may be helpful ;-)

    Cheers!
    Piotr
     
  42. Juntaou

    Juntaou

    Joined:
    Apr 7, 2010
    Posts:
    25
    Thanks for the quick response and tip. What ended up giving me the result I wanted was to take that point and manually move it to a good position. Hopefully it wont be too taxing on the system when there are a lot of units on the screen.
     
  43. Pauloxande

    Pauloxande

    Joined:
    Feb 8, 2014
    Posts:
    110
    friend I wonder if when you hit the Realist Prefab
    remove energy Bar1Prefab. I've tried a few things and nothing can give me a light
    I would put the energy to subtract when you press the Q "SLOW MOTION" could you help me


    if(Input.GetKeyDown(enterBulletTime)){
    if(!bulletTimeActive){
    Here?
    otherfx.clip = enterBulletTimeFx;
    otherfx.PlayOneShot(otherfx.clip, 1.0f);
    bulletTimeActive = true;
    }else{
    otherfx.clip = exitBulletTimeFx;
    otherfx.PlayOneShot(otherfx.clip, 1.0f);
    bulletTimeActive = false;
    }
    }
     
    Last edited: Feb 25, 2014
  44. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello,

    I'm not sure if I understand. Do you want to make the bar object invisible when bullet time is active?
    It's simple. Just deactivate the game object. You have to do something like this:

    Code (csharp):
    1.  
    2. public EnergyBarBase barObject; // the field
    3.  
    4. ...
    5.  
    6. bool shouldBeVisible = ... // set to true or false depending of the result that you want to achieve
    7.  
    8. if (shouldBeVisible  !barObject.gameObject.activeSelf) { // should be visible (but it's not)
    9.     barObject.gameObject.SetActive(true); // show
    10. } else if (!shouldBeVisible  barObject.gameObject.activeSelf) { // should be hidden (but it's visible)
    11.     barObject.gameObject.SetActive(false); // hide
    12. }
    13.  
    Cheers!
    Piotr
     
  45. Pauloxande

    Pauloxande

    Joined:
    Feb 8, 2014
    Posts:
    110
    No friend, is not to disappear or appear, is to remove the EnergyBar points when using the SLOW MOTION
    when you finish the energy stop the slow motion
    when the bar end ends the spells, in the case cancels the slow motion
     
    Last edited: Feb 25, 2014
  46. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    If you want to decrease or increase bar value then please look in here.

    And if "bulletTimeActive" variable decides about slow motion, then if block with condition "!bulletTimeActive" is block executed when bullet time IS NOT active. I believe you should place your code after the "else" statement ;-)
     
  47. Pauloxande

    Pauloxande

    Joined:
    Feb 8, 2014
    Posts:
    110
    I get it buddy! I've tried everything and nothing. I'm now using UFPS and do not know how to implement this UFPS.
    Can you give me a grateful light.
     
  48. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    I'm sorry, but it cannot help you with third party tools. You should eventually write to UFPS support.

    Cheers!
    Piotr
     
  49. ergoSum

    ergoSum

    Joined:
    Mar 1, 2014
    Posts:
    2
    Can I please confirm that anchoring an energy bar to follow a 3D character should work under the Daikon Forge GUI version of EBT?
    The BotRun example from your website doesn't apply directly, because seemingly anchors and fill progress bars must sit under the EBT->Camera 2D->Panel hierarchy. If left here, the bar shows but does not follow the 3D object. Actually I'm not sure what it follows...

    Must I ditch the anchors and write a script to update the position of the energy bar?
     
  50. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hello ergoSum,

    When using EBT with DF-GUI integration, it disables the position anchoring options because DF-GUI controls the position of its widgets (and bars). I don't know if there is a way to anchor DF-GUI widget to 3D object, but if there's none then you can:
    - Create a bar not in DF-GUI. Although you're using the integration, you still can create raw bars using Tools -> Energy Bar Toolkit -> Create Mesh Bar options.
    - Write a follow script for DF-GUI widget.

    Hope that helps,
    Cheers!

    Piotr