Unity C# Basic :: Part 17 :: Player Health Bar and update HP

Опубликовано: 21 Октябрь 2024
на канале: Unity No Code | Leo N
270
10

💬 Turn on [CC] to translate to any Languages [JP/FR/GR/EN/VI/CN/KR/ES... all supported]

⭐ Unity Your First C# game :    • Unity Your First C# Game  
( This Tutorial series for New Unity Beginner or Visual Scripting people want to level up their Unity skills. )

⭐ I always recommend to learn basic Visual Scripting first to understand C# easier and learn it faster :    • How to learn Visual Scripting - Zero ...  

✅ C# script "PlayerController" : https://github.com/leo69n/TutorialUni...

✅ C# script "PlayerHPBar" : https://github.com/leo69n/TutorialUni...

✅ Download Images : https://www.mediafire.com/file/8h70v5...

===
This Video : How To create a Shield for Player to prevent taking Damage repeatedly
1. Create HP Bar Background
2. Create HP Bar Color
3. Get Player HP from HP Bar
4. Apply Player HP into HP Bar
5. How to calculate HP Bar Width
6. Update HP Bar width by script
7. Change HP Bar texture

===
🍀 Code is boring ?... Let's try to make game no code with Visual Scripting ( Can make game in Unity after 1 week )
Learning Path for you :

🐾 Level 1 : Learn Unity basic in 2D game - For Beginner (all script and resource are FREE ) :    • Learn Unity Basic : Level 1 Beginner  

🐾 Level 2 : Learn Unity basic in 3D game - All videos (all script and resource are FREE ) :    • Learn Unity Basic : Level 2 - 3D Game  

🐾 Level 3 : Learn Unity basic 3rd Person game or 1st Person game (all script and resource are FREE ) :    • Learn Unity Basic : Level 3 - 3rd Per...  

🐾 Level 4 : Learn to use C# in Visual Scripting :    • Learn Unity Basic : Level 4 - C# in V...   ( Know how to use any C# plugins after this )

🐾 Level 5 : Make Multiplayer Online game with Netcode in Visual Scripting :    • Multiplayer Netcode in Visual Scripting  

=====
🔥 Download Visual Scripting Plus from Unity Asset Store to support me: https://assetstore.unity.com/packages...

=====
🏂 Any questions about Unity or Visual Scripting :   / discord   ( me @Leo69 )

Follow me at :
Instagram:   / leonnguyen0609  
TikTok:   / leonng_333  
Twitter : @unitynocode
Fb : unitynocode
Thread : https://www.threads.net/@unitynocode

#gamedev #gamedevelopment #unitynocode #csharp #madewithunity
=====
Chapters
0:00 - Intro
0:33 - Create HP Bar Background
1:07 - Create HP Bar Color
1:49 - Get Player HP from HP Bar
4:43 - Apply Player HP into HP Bar
6:27 - How to calculate HP Bar Width
7:49 - Update HP Bar width by script
9:25 - Change HP Bar texture