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

КОМЕНТАРІ • 41

  • @yozegami
    @yozegami Рік тому +6

    Man, you're a lifesaver. First tutorial series I've tried where everything just works. Thank you!

  • @michaelalexis5776
    @michaelalexis5776 3 роки тому +3

    Thank you for sharing your knowledge, your content is very good, I was looking for this series of videos :3

  • @BearCavalryWasTaken
    @BearCavalryWasTaken Рік тому +6

    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();

    • @OOF774
      @OOF774 3 місяці тому

      i don't get it

    • @OOF774
      @OOF774 3 місяці тому

      plz help

    • @OOF774
      @OOF774 3 місяці тому

      i just got more errors BRO!

  • @theeyeofmango
    @theeyeofmango 2 роки тому +13

    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();
    }
    }

    • @arcosic
      @arcosic 2 роки тому +1

      Thanks! I was just looking for this :D

    • @arielthemermaid3576
      @arielthemermaid3576 2 роки тому

      Thanks, you just saved my grade! (My project is due in 30 min lol)

    • @OOF774
      @OOF774 3 місяці тому

      thx so much!!!

  • @leonardocomposiçoes
    @leonardocomposiçoes 3 роки тому +2

    Great job! continue the series please!

  • @КащейБессмертный-ь2ж

    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

    • @FakuaBlock
      @FakuaBlock Рік тому

      I had the same problem I think its
      using TMPro;
      using system;
      then
      private TMP_Text amount;

  • @douglasdeal1
    @douglasdeal1 Рік тому

    yes can u make Inventory tutorial, bcuz i dont know how to make it!

  • @NickVanwyk-u7x
    @NickVanwyk-u7x Рік тому

    Really love it

  • @Ozaanaaa
    @Ozaanaaa 3 роки тому

    A content machine

  • @ghostxtempzz115
    @ghostxtempzz115 3 роки тому +2

    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.

  • @nicantic2675
    @nicantic2675 2 роки тому

    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

    • @loganology2572
      @loganology2572 2 роки тому

      Same did you figure it out??

    • @loganology2572
      @loganology2572 2 роки тому

      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)

  • @kamlakshsingh5977
    @kamlakshsingh5977 3 роки тому

    Your videos are awesome 🔥🔥 I really loved it!!!!You should try making a God War machanism!!! That would be great!!🙌🏻🙌🏻🙌🏻

  • @PeacefulChaos8700
    @PeacefulChaos8700 11 місяців тому

    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?

  • @biinz19_9
    @biinz19_9 3 роки тому +1

    next idea, can you teach me how to add zombies???

  • @triklettriklerbu1592
    @triklettriklerbu1592 2 роки тому

    15:18 public override doesnt work for me. Why?

  • @GWPSHORT
    @GWPSHORT 2 роки тому

    I have a problem that my health and max health does not get show in the ui

    • @SingleSapling
      @SingleSapling  2 роки тому

      Probably something wrong in your script

  • @biinz19_9
    @biinz19_9 3 роки тому +1

    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?

    • @SingleSapling
      @SingleSapling  3 роки тому

      You also have to have it marked as a virtual void in the parent script

  • @andry6638
    @andry6638 2 роки тому

    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

  • @OOF774
    @OOF774 3 місяці тому

    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!

  • @Demon.Immortalis
    @Demon.Immortalis Рік тому

    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();
    }
    }