Player Stats With UI - FPS Game With Unity & Blender
Вставка
- Опубліковано 5 лют 2025
- PLAYER STATS WITH UI
In the ninth episode of the FPS Game remake I show you how to add health to the player and UI.
Feel free to donate if you are rich :D
streamlabs.com...
Thanks to: Robin Brown, Tom Taborovski and Samin Grahic for their support on Patreon.
Discord Server - / discord
Patreon - / singlesapling
Twitter - / singlesaplingg
Reddit - / singlesaplinggames
Instagram - www.instagram....
DeviantArt - singlesaplingg...
Facebook - / single-sapling-games-2...
Itch.IO - single-sapling...+
Tumblr - / singlesapling
UA-cam - / @singlesapling
--Programs--
Engine: Unity - unity3d.com/
Modeling: Blender - www.blender.org/
2D Editing: Krita - krita.org/en/
Programing: Visual Studio - visualstudio.m...
Organization: Trello - trello.com/
--Outro Music--
Song: Horizon (feat. Tylah Rose) - Loreno Mayer & Haesën
Music provided by Ninety9Lives
Video: • Loreno Mayer & Haesën ...
Download: 99l.tv/88HorizonYU
--TAGS--
script make game for free 2020 development dev unity blender program tutorial guide new hd twitter youtube developer indie design art cool easy quick fast fps first person shooter game gaming how to intro introduction learn teach learning teaching livestream live stream indiegamedev indiegame indie unity2020 blender3d unity3d devlog
Man, you're a lifesaver. First tutorial series I've tried where everything just works. Thank you!
Thank you for sharing your knowledge, your content is very good, I was looking for this series of videos :3
Glad I could help
encase you can't get the text to change because you're using Text Mesh pro you can fix it by adding
Using TMPro;
and then do Private TextMeshProUGUI (insert name here) instead of just Text
and using (variablename).SetText((Variablename).ToString()); instead of (variablename).text = (variablename).ToString();
i don't get it
plz help
i just got more errors BRO!
In order to use TextMeshPro under Player HUD script use the following
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class PlayerHUD : MonoBehaviour
{
[SerializeField] private TextMeshProUGUI currentHealthText;
[SerializeField] private TextMeshProUGUI maxHealthText;
public void UpdateHealth(int currentHealth, int maxHealth)
{
currentHealthText.text = currentHealth.ToString();
maxHealthText.text = maxHealth.ToString();
}
}
Thanks! I was just looking for this :D
Thanks, you just saved my grade! (My project is due in 30 min lol)
thx so much!!!
Great job! continue the series please!
some tips:
Use TextMeshPro not Text.
In information UI elements disable Raycast Target.
In Text not use Rich Text.
For changes HUD values use not direct link but delegates or Unity events
I had the same problem I think its
using TMPro;
using system;
then
private TMP_Text amount;
yes can u make Inventory tutorial, bcuz i dont know how to make it!
Really love it
A content machine
Yes, who this?
I would love to know how to add a progress bar onto this like Call Of Duty: Cold War does with the player health in zombies as I'm trying to make a zombies style game.
Ok I will make a short video on how to add it
@@SingleSapling Thank you :)
SAME
he said a bad word!!!!! (Great tutorial)
p.s - Do u know what this error mean..... 'PlayerHUD' does not contain a definition for 'UpdateHealth' and no accessible extension method 'UpdateHealth' accepting a first argument of type 'PlayerHUD' could be found
Same did you figure it out??
I figured it out btw
in "PlayerHUD"
the line
public void UpdateHealth(int currentHealth, int maxHealth)
needs to have a space beetween "UpdateHealth" and "(int currentHealth, int maxHealth)"
should look like this
public void UpdateHealth (int currentHealth, int maxHealth)
Your videos are awesome 🔥🔥 I really loved it!!!!You should try making a God War machanism!!! That would be great!!🙌🏻🙌🏻🙌🏻
Single Sapling Games am I able to use your gun models and other stuff that are a bit hard for me to model as I'm kinda new modeling stuff in blender in my game that I'm wanting to sale as long as I credit you?
next idea, can you teach me how to add zombies???
Its coming soon
@@SingleSapling and enemy players?
Ye
15:18 public override doesnt work for me. Why?
I have a problem that my health and max health does not get show in the ui
Probably something wrong in your script
hey @Single Sapling Games, I wrote this code:
public override void CheckHealth()
{
base.CheckHealth();
hud.UpdateHealth(health, maxHealth);
}
but it kept saying "no suitable method found to override"
Do you know how to fix it?
You also have to have it marked as a virtual void in the parent script
Hello, your videos really awesome. But can you or someone help me? my current health still 100 when i press 'X' Button to check TakeDamage
this sucks i spent 3 days becas i did the script 4 times and then had a guy who had been making games for 9 years try to help and it did NOT!
For the ones using TMPro use this script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class PlayerStats : CharacterStats
{
[SerializeField] private TMP_Text currentHealthText;
[SerializeField] private TMP_Text maxHealthText;
public void UpdateHealth(int currentHealth, int maxHealth)
{
currentHealthText.text = currentHealth.ToString();
maxHealthText.text = maxHealth.ToString();
}
}