Cast Time Abilities (bar only)
Requires addon “https://discord.com/channels/1090763611938496553/1418235171475296380".
In can be included eveywhere, in this case include it in the player. Note that you can a should ajust the size of the bar, and the text it’s optional.
Usage:
- Show with no text and the bar reduces: castTimeBar.?Show(<time_in_seconds>)
- Show with text: castTimeBar.?Show(<time_in_seconds>, )
- Show fill the bar: castTimeBar.?Show(<time_in_seconds>, , fill>) ex: castTimeBar.?Show(2f, “”, true)
Import package
This package comes with the script and the UIHUDCountdownBar.prefab.
Find were you want it
I’ve had it in the abilities prefab, and in the video i have it assign to the user (WOW style).
Change the CharacterBase.cs including the following:
[Header("References")]
[SerializeField] private UIHUDCountdownBar m_castTimeBar = null;
public UIHUDCountdownBar castTimeBar => m_castTimeBar;
The go to the 0_Hero_Base prefab, and drop the UIHUDCountdownBar inside and ajust it in the position and size you want.
Click on the parent (i.e. 0_hero_base) in the inspector in the Hero component, assign the UIHUDCountdownBar
Make a trigger
Now there’s many ways you can do this, but the since we are extending the Cast time abilities we’ll put it in the method CastThen after the if(cast<=0f) condition:
if (cast <= 0f)
{
onCastComplete?.Invoke();
yield break;
}
m_character.castTimeBar?.Show(cast, activeAbilitySheet.displayName, false); //ADD THIS

💬 Comments (27)
0_Hero_Baseokay my bad i’m super late on this, nope nothing i have:
and i’m still getting that error
i suppose this is how it’s supposed to look?
No, i imported the package and it put the scripts in the same folders as you then (i suppose?)
Also which exact folder are you talking about? 🤔 the only one that i changed was from “mythril2d” to my game name
Since you changed from mythril2d to terradune. Is that thing
Most likely.
You either have the file outside of the source root of your files and are missing the unity configuration to point to the new folder (is something you do in the settings), or the namespace of the script i provided is not the same as yours.
Want to continue the conversation?