Our developer interviews have moved to our new sister site, Chasing XP!
You can find this interview here:
Get notified of new articles and have fresh tech news delivered straight to your inbox.

on
Our developer interviews have moved to our new sister site, Chasing XP!
You can find this interview here:
Get notified of new articles and have fresh tech news delivered straight to your inbox.
Mark Byrne is the Co-Founder and Senior Editor at TechLater.com. He is a lover of all things technology, a champion of the developer, and the brains behind the web development side of the website. He will be found wandering the pages of TechLater.com, writing what he believes is "solid content". Without Grammarly and spell check, he would be doomed, however. Mark is based in the North of England, and has recently changed all of his laptop's language options to USA English.
TechLater presents: The Chasing XP Podcast.
Developer interviews, industry chat, indie development discussion and more.
Listen now!
Working on a project recently, I came across a very simple, and obvious way of creating a color changing HP bar (or any progress bars) in Unity, that change color based on the amount of health left. And yet I have never seen this being used, and never used this myself before. In the next few minutes, you’re going to learn the fastest way, of making color changing HP bars. UI setup So first let me show you the scene setup I have in place. There’s a simple HP bar, and a couple of buttons to increase or decrease the health. game scene The HP bar is a simple Image for bar background, and another UI image with Image type “filled” which is the actual bar part. There is a TextMeshPro text gameObject in the ‘OtherUi’, along with the + and – buttons to increase and decrease HP which will be indicated graphically by the filled bar and the TMP text. scene setup filed area Image inspector Code Alright!, now that you’ve seen the scene setup, let’s get to the code part. So I created a new Script called ColorHP.cs , and here’s the code : using UnityEngine; using UnityEngine.UI; using TMPro; public class ColorHP : MonoBehaviour { public TMP_Text currentHpText; public Image filledBar; public Gradient hpGradient; private int currentHP; public int maxHP = 100; void Start() { currentHP = maxHP; UpdateUI(); } public void PlusHP(int changeAmount) { currentHP = Mathf.Clamp(currentHP + changeAmount, 0, maxHP); UpdateUI(); } public void MinusHP(int changeAmount) { currentHP = Mathf.Clamp(currentHP – changeAmount, 0, maxHP); UpdateUI(); } void UpdateUI() { currentHpText.text = currentHP.ToString(); filledBar.fillAmount = (float)currentHP / maxHP; filledBar.color = hpGradient.Evaluate(filledBar.fillAmount); } } Inspector setup Then I added the script to the parent “HP bar” gameObject. Assigned the required fields for variables “Filled Bar” and “Current Hp Text”. Then I made the color changes in Hp Gradient, you can do so by clicking on the gradient. you can click on the lower edge to create a Color Key, and upper edge to create a new alpha key. Mine looks like this : Then I assigned the “PlusHP” and “MinusHP” functions to the + and – buttons, and put a change value of 10. And that’s it, we’re ready to test the Color change functionality. Color Changing HP Bar in Unity – The Final Result https://youtu.be/8oQAQbR_hCo final result Using the gradient gives you much more flexibility over the color control then any other way like Lerping between colors would. If you want me to explain how the code works, or how to make a progress bar UI, let me know in the comments. I hope you found this useful, and that you’ll use this for your games. I’ll be uploading a tutorial for this on YouTube soon, covering how the code works as well, for that follow me on twitter (@BuluSama) to stay updated. https://twitter.com/Bulusama Have a nice and productive day!!!
Our developer interviews have moved to our new sister site, Chasing XP! You can find this interview here: Interview: “Terra Invicta” Developer Johnny Lumpkin
Our developer interviews have moved to our new sister site, Chasing XP! You can find this interview here: Interview: “Siebenstreich” Developers Golden Orb
Our developer interviews have moved to our new sister site, Chasing XP! You can find this interview here: Interview: “Lumberhill” Publisher Another Road Publishing
Our developer interviews have moved to our new sister site, Chasing XP! You can find this interview here: Interview: “Ebon Light” Developer Ahnna From Underbliss
Our developer interviews have moved to our new sister site, Chasing XP! You can find this interview here: Interview: “Ikai” Developers Endflame Studio
Our developer interviews have moved to our new sister site, Chasing XP! You can find this interview here: Interview: “There’s Nothing To Do In This Town” Developer Simeon Smith
If you’re looking to get into game development, you’re likely staring at these two options. I’m going to discuss both pros and cons of each and hopefully, you’ll be able to decide if Unity or Unreal Engine is what’s best for you. Before deciding, it’s important that you ask yourself and consider some key points. Is Coding Knowledge Necessary? Truthfully, if you’re just starting your career, you don’t need to know how to program. The best thing when making a choice of Unity or Unreal is that both have systems in place to make games without coding. Although it’d be for the best if you understood programming at least at a basic level, you can still get by. Unity’s solution is called Visual Scripting and it’s a pretty simple method. You simply assign values and actions to boxes and connect them. However, you would be able to fully utilize this tool if you knew even a little bit about programming. Stuff like data types, functions, objects, or just boolean algebra could be a game-changer. To get the most out of Visual Scripting, it’d be best if you were familiar Unity documentation The biggest downside to Visual Scripting is that it’s still in development. Yes, we are getting an update every six weeks or so, but we still don’t have a stable version. On the other side, we have Blueprints. The premise is pretty much identical – simplified visual representation for coding. Broadly speaking, there’s almost no difference in concept or execution between the two. Despite the crudeness, this looks much easier to navigate than code Blueprints, however, is a slightly better choice at the moment, mainly due to its longevity and better support. For the moment, Blueprints is an easier option as it comes with Unreal out of the box. The key separating point is that these engines use different programming languages. but if you’re coming from a non-coding background, you likely won’t care. Unity Or Unreal == C# or C++ Here lies the crux of the issue. If you’re not proficient with these two languages, you’re probably going to choose C# and Unity. C++ comes from C and C# is claimed to be the successor of C++. Fun fact: upon release of C#, people dubbed it Java-clone. There are reasons for both of these claims and it’s good to know why the language is key when choosing Unity or Unreal. Unreal Engine And C++ So, C is an ancient language (well, from a technology point of view as it dates all the way back to the 1970s), but it is very good in carefully managing computer resources. Back then, programming languages needed to be capable of that as there were no fancy garbage collectors or anything similar. C++ retains C’s memory management capabilities, but also adds another dimension. It introduced a revolution – object-oriented programming or OOP. Without getting too technical, OOP groups data and specific functions into objects which can be duplicated. The OOP approach allows for much smoother and streamlined programming experience. C++ is not alike most languages out there If you’re looking to really be in charge of the memory and processes of the machine, then C++ is a perfect choice for you. Another reason why you may choose it is because you already know C. As far as syntax goes, the two languages are pretty similar. In fact, C++ is much easier to understand than C. The key reason why you might choose C++ and Unreal Engine is that you’re familiar with the language and know how to manually optimize performance. Unity’s C# And then there’s C#. Despite diverging a lot from its origin point where it was compared to Java, it’s still pretty similar. So, if you’re coming from Java, you won’t have any problems with C#. Data types differ a bit, but the core OOP system is pretty similar. C# looks readable even to a non-programmer Out of the two, C# is miles better than C++ for beginners, and if you’re coming from Java, you’re going to feel right at home. Declarations and data types are pretty literal and the conventional wisdom is to use descriptive function names which makes the code super easy to read. Unity Or Unreal – Which One Looks Better? Getting into game development, you were likely inspired by a mainstream title you played when you were younger. If you think you can outright make a new GTA, those dreams need to be shelved. For now, at least. Making a triple-A game requires a triple-A budget and a team of dozens or even hundreds and thousands. Still, there’s no reason to give up on having good looking graphics for your game, but maybe on a smaller scale. Both Unity and Unreal have some really impressive graphics capabilities, but the latter always stood out a bit more. https://youtu.be/qC5KtatMcUw Example of Unreal Engine 5 running on a PS5. The latest update to the software. Nowadays, they are comparable, but that hasn’t been the case in a long while. C++ enables Unreal to have much more heavy-duty and optimized 3D performance. Smoother, too. That’s not to say that Unity will give a sub-par look, it’s just that it isn’t as good. Admittedly, Unity made some incredible strides in the last few years and a layman would be hard-pressed to find the difference. Those with a keener eye will definitely notice the difference, but with how fast Unity is closing the gap, that difference will only get more and more negligible. https://youtu.be/YbeRWb-cJ7I Siren Head: Retribution, an indie game created using Unity. Seen here played by a member of the TechLater team. Overall, without a capable artist (or a few) on your team, there’s almost no difference between the two as far as visuals are concerned. And with ray tracing possible with both engines, you can get a great look for your game with a lot less effort than previously needed. Unity Or Unreal – The Best Value This is the most exciting …
Our developer interviews have moved to our new sister site, Chasing XP! You can find this interview here: Interview: Hive Time Developer Josh “Cheeseness” Bush
In the past, Google hasn’t bothered developers with the Google API consent screen setup (making it optional in most cases) until now. As a developer, without any doubt, Google is one of the most valuable platforms that offer services to make your life easier. Although, this is nothing new and as a matter of fact, I don’t doubt you aren’t already using Google for your developing purposes. Outside of the developer’s universe, Google is widely known among ordinary daily users of gadgets. From mobile phones to Tv sets to wearables and on and on the list goes. Not just at a hardware level but also at the software level, Google once again is no doubt among to first go-to in these markets. Google For The Developer Just a few days ago, after giving my client a project I just finished for him – which uses google API for its major functionality, I showed him just how to configure his Google account to enable the API on his end (of course, using screenshot and text guide.)Just when I thought my work had been completed, it turns out that it’s still on-going! To cut the story short, it turns out that Google has made changes to their interface and unlike before, you need to do one thing before you can get started. Keep reading to find out what you need to do. Using your Account Their are two main ways to access google services (most services) programmatically. API KeysOAuth 2.0 Client IDs For all my work using Google API – for as long as I can remember, I have been loyal to the OAuth client ID. Not once have I used API Keys for any of my credentials. I can talk about the pros and cons of both nevertheless, I prefer theOAuth. Take this Google link for example, for me, it’s the quickest way to get started with Google API. I use the link because I am a fan of Python and I use the link whenever I am starting a new Google API project. If you happen to prefer other programming languages over Python for your dev work, you can check out this link for other languages. Here’s what you need to do, click on the big blue button to get you started. The popup and whatever comes next are self-explanatory and easy to follow. It’s at this point that things went south on my client’s side. After downloading the credentials.json files, he ran the program as he should but nothing happened (the program didn’t communicate with Google server). So I had to return to debugging the situation. At first, I thought he was doing it wrong and he also thought I wasn’t detailed enough on how he should have proceeded. As the saying goes “customers are always right” that was what made me return to my Google account and do a clean up so I could be sure what was happening. The Google API Consent Screen As it turns out, Google has changed the requirements especially for those starting a new project and using the API for the first time. If you are starting out with a new account or starting a new project, you will be required to fill the OAuth Consent Screen something that wasn’t a must in the past. This was the stumbling block that was holding my client back. OAuth Consent Screen Click the Create button without selecting any of the options. When the next page shows up, the External will be the one to be selected by default for you. This page has a number of fields that at first, would look like you need to fill it all out, but the fact of it is that you only need to fill one of the fields. Of all the fields, you only need to fill the Application name. OAuth Consent Screen Form After filling the field, the save button below the form will be enabled for clicking. If you are following the google guide from the link I posted above then you should be set.To check out more helpful guides, hints and tips, check out the TechLater Developer Hub
We have a number of indie developers writing for TechLater.com, and we’d love to provide you with a platform to chronicle your journey – be it game development, coding, designing, ethical hacking or any other computer science.
It’s easy. Simply register here, and start writing!
Get notified of new articles and have fresh tech news delivered straight to your inbox.
You must be logged in to post a comment Login