How to make an Animated Charge Bar

<p><strong>Objective: Create a bar that&rsquo;ll charge up using IPointerHandler events!</strong></p> <p>There are some event system&rsquo;s that we can use from Unity with the UI system. Here are some of the supported events.</p> <h2><a href="https://docs.unity3d.com/Packages/[email protected]/manual/SupportedEvents.html?source=post_page-----8ff87b6b1640--------------------------------" rel="noopener ugc nofollow" target="_blank">Supported Events</a></h2> <h3><a href="https://docs.unity3d.com/Packages/[email protected]/manual/SupportedEvents.html?source=post_page-----8ff87b6b1640--------------------------------" rel="noopener ugc nofollow" target="_blank">The Event System supports a number of events, and they can be customized further in user custom user written Input&hellip;</a></h3> <p><a href="https://docs.unity3d.com/Packages/[email protected]/manual/SupportedEvents.html?source=post_page-----8ff87b6b1640--------------------------------" rel="noopener ugc nofollow" target="_blank">docs.unity3d.com</a></p> <p>To start this project, we will need a background image, a TextMeshPro Text object, a slider, and a button.</p> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:164/1*XwjjudkCtBoC3Uq6SAUYTA.png" style="height:90px; width:164px" /></p> <p>They can be placed where ever fits the design.</p> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:420/1*WEHPOYdPwDCFhJttOAFiwg.png" style="height:262px; width:420px" /></p> <p>Now for the coding. We will only need one script. This script will need to grab the UnityEngine.UI, UnityEngine.EventSystems, and TMPro library&#39;s.</p> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:312/1*GIpdtbKjUU0rQHHXK5MGvg.png" style="height:150px; width:312px" /></p> <p>Once the UnityEngine.EventSystems is grabbed, add in after MonoBehaviour to inherit the IPointerDownHandler and the IPointerUpHandler. When these get typed in, the IDE that is being used will give you an error.</p> <p><a href="https://tylersmallwood.medium.com/how-to-make-an-animated-charge-bar-8ff87b6b1640"><strong>Website</strong></a></p>