Home

Sunday, October 12, 2025

CAGD 470 Sprint Blog 3

10/12/2025

Sprint 3 Kickoff

At the start of this sprint, I was assigned some more programming tasks and a couple other ones that involved setting up our UI to showcase our players charges.


As I mentioned one of the key things I worked on this sprint was creating our games Sun Pillar working. This required quickly creating a simple prefab that I could use to test. I made a mock-up prefab and attached a collider to it so that my player could detect collisions with it. After that I made a tag for it and attached it to itself in the inspector. The way I got it to work was by creating a function inside my player controller script that would allow for this pillar to recharge my player’s sun charges if they collided with and stood there for a total of 5 seconds. 




After I made that I also wanted it to only grant me 4 charges and once I had the max amount of charges it would no longer keep charging our player. This was simple enough since I already had the recharge function working properly. The last thing I needed for this to fulfill my assigned card was to showcase some sort of visual for our character model charging.

This was perhaps the hardest thing to tackle since I had never altered any material in unity before but after a couple of searches, I was able to figure it out. I had to grab a reference of my players assigned material through code and I did that by assigning it in my start function.  Once I did that, I created 2 new functions, one that would play a pulse glow mechanic to show the physical glow when charging and the other to fade out the glow in a smooth way when my player reached full charge. I was able to make them work by creating a new color variable that would essentially be my new glowing color and setting my players material to this new color for a short period of time. Along with that I made some other variables that would handle the glow intensity.


Once I had these 2 functions working properly, I made sure to call them whenever my recharge function also gets called in my update. Getting this to work was so awesome since it is a huge feature we wanted to implement this time around. 






After all that I moved on to making sure our 2D sprites were properly hooked up to our UI so that we can now effectively display charges on screen. Since the 2D sprites were made last sprint, it was easy enough to have them hooked up. What I did for this was to go back into my player controller script and make 4 new variables for game objects. This 4 would be specific for each one of my groups of UI images I made inside of unity.



Each group consisted of 2 images, one to showcase when the charge is active and the other show it empty. Once I had those ready, I simply wrote 1 if statement followed by 4 else ifs in order to set those game object variables to off. It was easy enough to go down the line for each scenario where in the first statement they are all active and in the last one they are not. They all essentially just check to see how much sun charges my player has. 

That was pretty much my main focus this sprint with the exception of a few other things and ultimately, I think my team really stepped up this sprint and I believe we are beginning to head in the right direction.


No comments:

Post a Comment

CAGD 470 Sprint Blog 3

10/12/2025 Sprint 3 Kickoff At the start of this sprint, I was assigned some more programming tasks and a couple other ones that involved se...