POLISH your Game with Damage Popups! (Unity Tutorial)

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 349

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  5 років тому +34

    This was a really cool effect to make!
    What other things would you add to it?

    • @selmansavas586
      @selmansavas586 5 років тому

      Hello, its not the place to ask a question, but i really wanna know another alternative. In a game im making, sometimes there are so much point popups, it affects the performance significantly. Is using text mesh pro more performance option, or is there someway i can use sprite renderers to circumvent unity's ui system?

    • @CasualCosta
      @CasualCosta 5 років тому

      Hi! Found your channel last week and I've been watching your videos whenever I have time. Don't know if have anything on that, but I would really like to see something turn-based, like RPGs, tactical games and card games.

    • @lhorbrum1818
      @lhorbrum1818 5 років тому

      @@CasualCosta Turn base system would rock, add my vote too.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +1

      If you have so many popups that is causing issues what I would do would be make a mesh based system.
      Game Objects are very computationally expensive so if instead of creating thousands of objects you simply have one with a mesh it will be much more performant.
      However that does require you to build a mesh system and handle building the quads to display each number, etc.
      Takes a lot of work but if you're sure that's the bottleneck then look into it.
      Yeah I would like to do a Turn Based tutorial, I created a simple Turn Engine for the Livestream game and I'm looking into how I can make a video about it.

    • @MARUTI96
      @MARUTI96 4 роки тому

      I want to deal attacks to multiple enemy(1 shot 4 hit ,like that)

  • @NewbNinjas
    @NewbNinjas 2 роки тому +51

    If you get the following error:
    ArgumentExeption: "The thing that you want to instantiate is null."
    Make sure you've put the GameAssetrs prefab inside the Resources folder in your project hierarchy.
    This had me racking my brains for about an hour :)

    • @4SheR
      @4SheR 2 роки тому +4

      u're my savior mate

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

      Thanks!

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

      @@4SheR Yeah it had my mind in bits for hours :D

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

      Legend. Thanks man.

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

      After hours of headaches, I was about to give up on this video. Really thank you very very much.

  • @tigwykplaysgames
    @tigwykplaysgames 2 роки тому +4

    I know it's been a while since this video was published but I used it yesterday to add really sexy damage popups to my game. Thanks so much for the tutorial!

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

      I'm glad the video helped you! Best of luck with your game!

  • @mario_actually
    @mario_actually 3 роки тому +5

    It’s crazy how often you have the exact videos that I’m looking for. So prolific.

  • @grandmasterhsu
    @grandmasterhsu Рік тому +1

    Thank you so much for this tutorial, it really helped a lot and i learned a lot. since this is a 4 year old video there are a few issues that came up for me, ill list it here for anyone else in the future:
    * GameAssets requires the GameAsset to be created in the Resource folder
    * i had some issues with the Utils class because i'm using the new input system so i wrote my own camera to world pos for the clicking portion.
    * Utils class also gave me problems with the hex color conversion. so i replaced that portion of the code with new Color(R,G,B)
    and since im working with 16x16 grid i had to downscale the font size and some of the small float tweaks to fit my scene better. overall it worked out great and im really grateful.

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

      jesus?
      This was exactly what i was looking for, thank you.

  • @vernavictor868
    @vernavictor868 4 роки тому +1

    to me he is at another level in programming, since i am myself a beginner(new to c# programming), its really hard to catch up. But i do learn from him how to make my program more cleaner and thank you. this video really help me a lot.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +2

      It's all about experience, I've been writing code for 20 years so just keep at it and you'll get there one day!

  • @electromorphous
    @electromorphous 4 роки тому +15

    This was amazing! That's a lot!!
    Highly underrated channel. It's one of the best gameDev channels I've found.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      Thanks!

    • @beri4138
      @beri4138 4 роки тому

      It's not very popular because he codes at mach 10 speed and no one can understand his complicated scripts.

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

      @@beri4138 ok boomer

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

      @@Zac_Bacs ok zoomer

    • @cityjudez
      @cityjudez 9 місяців тому

      why you lying???

  • @kerzengrenzen6383
    @kerzengrenzen6383 5 років тому +4

    Your ad brought me here. This was the First usefull commercial ive ever saw

  • @JoseORosario
    @JoseORosario 4 роки тому

    This is pure gold, i think this would benefit from the getcustomdir function of yor utilities, maybe some easing on the transition.

  • @bramvanwambeke1859
    @bramvanwambeke1859 5 років тому +26

    Is that intro new? Its the first time i noticed it, it looks really nice.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +6

      Yeah trying out a couple of new things, glad you like it!

  • @beri4138
    @beri4138 4 роки тому +1

    If you get runtime errors, use the type TextMeshProUGUI instead of TextMeshPro. I've had errors for DAYS and the thing didn't work until I had the bright idea to use TextMeshProUGUI. Now it works perfectly.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      That depends on what object you used when making the prefab. The UGUI version is the UI version whereas the normal one is a world space text object. Both of them work the same but you do need to use the same type in code and in the editor.

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

    You're the best. Really, I did not believe I could implement that so easily !

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

    Instantly subscribed after this , and added to my RPG Game!!!

  • @jasielt.2006
    @jasielt.2006 4 роки тому +1

    this really helped me with my game mane, thanks a lot for the tutorial much appreciated

  • @mmabnoob814
    @mmabnoob814 5 років тому +5

    Keep up the good work... thanks 🙏🏻

  • @DeathGOD7
    @DeathGOD7 5 років тому +2

    Great for me....learning game dev so doing platformer not straight 3d

    • @indieprogress7170
      @indieprogress7170 5 років тому +1

      If want to do 3D, some of the systems between 2D and 3D are similar. I started learning 3D and a lot of the systems are similar with minor changes to the syntax as it is (x,y) vs. (x,y,z)

    • @DeathGOD7
      @DeathGOD7 5 років тому

      @@indieprogress7170 yeah

  • @gideongriebenow5815
    @gideongriebenow5815 5 років тому +2

    Thanks for all the great content! I for one appreciate the reasonably fast pace your videos takes - this allows you to quickly go through and understand what gets done, then pause where you need to as you dig deeper. I am a Unity Newbie, although I've been coding (older languages, mostly not object oriented unfortunately) for many years. I am trying to adjust this demo to allow me to create temporary moving icons (images) on the UI - like a gold coin jumping smoothly from one place on the UI to another and then disappearing. I used RectTransform in place of Transform. The image gets created successfully within the UI structure by specifying the parent on the Instantiate call, and simple linear movement from point A to point B within X seconds is working already. I'm now trying to get some interesting "paths" built in, still need to see how I will parameterize the Image to be shown, and I'm struggling to implement the "Destroy()" call without hard-coding the name of the object. any pointers on the Destroy call would be appreciated.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      In order to Destroy all you need is a reference to the object so it depends on how you are creating and animating your icons.
      If you're doing a similar pattern in the video where the icon moves itself you can do the same thing Destroy(gameObject);
      If you're spawning them in sort sort of UI Script then that script needs a list of the currently active popups and call Destroy on them when it's time.
      For some interesting paths you can either do like I did in the video and make it code based or you can also create a AnimationClip.

    • @gideongriebenow5815
      @gideongriebenow5815 5 років тому

      Do you have a Patreon or similar page for donations? I didn’t see one on the website.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      Don't have a Patreon but if you'd like to support the channel you can pick up the Game Bundle from the website and play my games.

    • @gideongriebenow5815
      @gideongriebenow5815 5 років тому +1

      @@CodeMonkeyUnity Done!

  • @Nazgul
    @Nazgul 4 роки тому +1

    Ppl trying to follow your guide but the speed is crazy and valuable step could be missed even using pauses

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Dont worry about having to pause. Your goal should be to learn so don't worry if it takes you a while to follow the video, just make sure you understand it.

    • @Nazgul
      @Nazgul 4 роки тому

      @@CodeMonkeyUnity Well, I got your point about implementation this (thanks for good explanation!) however I was curious what TextMesh settings you use to get such text design.. and it was not easy because of the speed :(

  • @indieprogress7170
    @indieprogress7170 5 років тому +8

    Great video and explanation!

  • @KrazyKain
    @KrazyKain 4 роки тому +3

    Hey thanks for the video, got yourself another subscriber :) I was looking for a way to get cool looking damage numbers in a JRPG combat system, and this works great with a bit of tweeking to encorporate different colours for diferent damage elements and the like. I'm very happy with the results.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      You can even combine it with custom fonts to make it crazier ua-cam.com/video/nBcP7FaDPE0/v-deo.html

    • @KrazyKain
      @KrazyKain 4 роки тому +1

      @@CodeMonkeyUnity haha nooo, why would you do this to me? I'm trying to stay focused on my development goals, I can't fall down a tangent... but it does look like it could be useful... I should probably watch it....

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

    If someone having Text not showing or disappearing after damage popup is spawned, this might help -
    “If you are using a mixture of normal TextMeshPro objects and TextMeshProUGUI objects which happen to share the same material preset, this can produce this behavior as the MeshRenderer and CanvasRenderer systems are fighting over the ZTest on these objects.
    Solution: If that is the case, the solution is to have a set of Material Presets for the normal text objects which are in worldspace and another set for the objects using the canvas system”

  • @KEM4OFFICIAL
    @KEM4OFFICIAL 5 років тому +4

    Well done CM. From a coder perspective nice, but I guess these things mostly are done with animation (moving, disappearing parts). Overall, thanks again for the great work.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      Yeah the animation of the popup could certainly be done with a AnimationClip.

  • @LeFede
    @LeFede 4 роки тому +1

    UNDERRATED videogames developing channel.
    You are a beast and surely deserve more views per video.
    Thank you and greetings from Argentina.

  • @micaiahstevens8840
    @micaiahstevens8840 5 років тому +2

    NICE zoom in on the text! (Make its snap and easier to see in Visual Studio)

  • @thecaptainFR
    @thecaptainFR 5 років тому +1

    Just discovered your channel ! Quality content very well explained! Continuous like that!

  • @rethateadmiragacha4849
    @rethateadmiragacha4849 5 років тому +6

    In my case when I was following the tutorial step by step, I had to set 'disappearTimer' variable this way:
    private static float disappearTimer;
    instead of 'non static'.
    Without being 'static', that variable was set to 1f in the first frame, and then suddenly to 0 in the second frame, then to 1f in the next one, and so on.

  • @RedstoneHair
    @RedstoneHair 4 роки тому +1

    Should also make a tutorial on a tutorial dialogue, where some text teaches the player to navigate through menus

  • @linuxe93
    @linuxe93 4 роки тому +3

    Very good turorial! I, however, think that the sortingOrder solution should be re-thinked. You will eventually (even though it might take a while) run into an integer overflow exception

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

      Not a big deal. At some point a single group would be have wrong sorting order but it would fix itself.
      However if you are concerned you can set it to 0 when there is no shown damage

  • @JadenJin
    @JadenJin 4 роки тому +7

    It gives me an error with the gameasset one

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

      Create a folder names Resources, put your prefab named GameAssets in that folder

  • @tamizhankeyframe6365
    @tamizhankeyframe6365 5 років тому +3

    I put like first blindly for cz I knw u always give good one 😂😍

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

    Another great video. Thanks

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

    Thanks you! It was very helpful for me!

  • @theskeleton8666
    @theskeleton8666 5 років тому +1

    I find this very useful thx 👌

  • @chivalryfutures3666
    @chivalryfutures3666 7 місяців тому

    Thanks so much!

  • @dpg8409
    @dpg8409 5 років тому +3

    Bro your chanel is like a holy grail for me

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

    Thank you!

  • @RAPHAELSC
    @RAPHAELSC 4 роки тому

    Great. You are a pro with programming and unity!

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

    Very helpful, thanks! :)

  • @anzalladhamara
    @anzalladhamara 5 років тому +1

    This channel so help me grow my game developer skill. Cool !!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      Glad to hear that! It's my goal with this channel!

  • @MARUTI96
    @MARUTI96 4 роки тому

    Thank u for the video

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

    Thanks, great

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

    thank you

  • @ovs_cosplay
    @ovs_cosplay 4 роки тому +1

    This video is great! Helped me a lot!
    Is someone have the link to the video explaining more about the GameAssets class ?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Its here ua-cam.com/video/7GcEW6uwO8E/v-deo.html

    • @ovs_cosplay
      @ovs_cosplay 4 роки тому

      Thanks !! You are the best ♥️

    • @TehBunnieh
      @TehBunnieh 4 роки тому

      @@CodeMonkeyUnity Thanks I was looking for this as well

  • @lhorbrum1818
    @lhorbrum1818 5 років тому

    Amazing! Thank you!

  • @superking9945
    @superking9945 5 років тому +2

    There are lots of tutorials to make like for 2d top down shooter rpg like game
    Shooting, enemy ai,damagable blocks, gun reload system, gun swap system etc.
    There are lots of tutorials to make
    Can you make any one of them plz?

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

    Welp, trying to figure out the whole resources thing ended up screwing my project's directory so that's great

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

      How so? You just create a folder anywhere called Resources, that's all

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

    thanks a lot for the nice video but sometimes you move mouse way too fast, that makes me rewind and slow down the speed just to see what you are doing. A good example is when you create a new sorting layer , in 07:14 - 07:19

  • @frontend_ko
    @frontend_ko Місяць тому

    nice video

  • @glory9605
    @glory9605 5 років тому +1

    Very nice pro

  • @xeonviento9778
    @xeonviento9778 5 років тому +2

    Would love to see a tutorial on how to do some of the effects applied in JuiceFX programmatically in Unity.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +2

      Wasn't familiar with JuiceFX but upon seeing the videos it seems like a really cool program.
      Those types of animations are certainly great for adding juice to your game. I'll look into it, thanks!

  • @folkhero2046
    @folkhero2046 4 роки тому

    Lots of code... Maybe too much for me right now. Maybe I'll revisit this when I'm polishing my game. Thank you for the video all the same

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

    awesome method CM .. But I am curious that the same effect can be made with the UI Canvas sys ??

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

    If you couldn't spawn the text where you click and you're in 3D project, try changing it into 2D one.

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

      If you're wondering about how to get the mouse position it's a different method in 2D and 3D unitycodemonkey.com/video.php?v=0jTPKz3ga4w

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

    Nice

  • @YannickGames
    @YannickGames 5 років тому +10

    Thank you for this tutorial, it was very usefull!
    But when I tried to Refference the pfDamagePopUp with the GameAssets Skript I got the ArgumentExeption: "The thing that you want to instantiate is null."
    So I needed to get the refference with a workarround. Any Idea why this happened?
    Because I really like the Idea of the GameAssets Skript to easily acces different refferences

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +3

      The reference is in the GameAssets script which is attached to a object in the scene, drag the reference on there. That object is a prefab so make sure you update the prefab after you drag the reference.

    • @SoulsElite
      @SoulsElite 4 роки тому +21

      You are missing the "Resources" folder. Put GameAssets prefab in there. it was not explained in this video.

    • @thathurtabit
      @thathurtabit 4 роки тому

      This really confused me too. @SoulsElite kindly pointed out we're missing the Resources folder, but research into Resources points out that it shouldn't be used at all:
      "3.1. Best Practices for the Resources System
      : Don't use it." :(
      From: learn.unity.com/tutorial/assets-resources-and-assetbundles#5c7f8528edbc2a002053b5a7

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

      @@SoulsElite thx man

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

    No doubt one of the BEST unity teachers. Love it. Code monkey is the # 1 place to to..
    I have a question. I followed the tutorial and even downloaded the project files to ensure I got every line correct. I do not have a enemy handler so I tried to use it with my own enemy script. Can you please show or explain how to set this up with an very simple enemy script?? I take damage when my bullets hit me, so I tried to put the code in there, I get error messages for the damage amount?? Please advice

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

      What error messages? You just need to call the DamagePopup.Create(); function

  • @marularch
    @marularch 5 років тому +1

    I was really excited to find your channel but this is really hard to follow. I first needed to find how to import the packages, then I needed to figure out finding the same scene you used and then when I finally wanted to see what you're doing you're lightning fast. I can't even see what you're doing with the Unity Interface, this needs to be watched at 0.5x speed.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      Do you mean when setting up the text object? I sped it up because the specific settings of the text object aren't really relevant to creating the popups.
      Your game probably has a different style than what is shown in the video so the look of the popups will be dependent on what you're using it for.

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

    I cannot type that quickly....

  • @ikasohma9748
    @ikasohma9748 4 роки тому

    nice tutorial, you dont need to fast forward the clip though it makes it very hard to follow

  • @alexw9309
    @alexw9309 5 років тому +1

    Hi nice Tutorial as always. Is there a Tutorial where u build the blood effect? I know there is one for the blood trail, but there u use the finished effect. Im asking more for the blood particle effect itself?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +1

      Haven't managed to do a video on that yet, it's on my list.
      Essentially there's a giant mesh and every blood particle is a quad in that mesh that moves and then stops.

  • @newworldstream1259
    @newworldstream1259 5 років тому

    ArgumentException: The Object you want to instantiate is null.
    UnityEngine.Object.CheckNullArgument (System.Object arg, System.String message) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:383)
    UnityEngine.Object.Instantiate[T] (T original) (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.bindings.cs:274)
    GameAssets.get_i () (at Assets/GameAssets.cs:10)
    DamagePopup.Create (UnityEngine.Vector3 position, System.Int32 damageAmount) (at Assets/Prefab/DamagePopup.cs:11)
    Testing.Start () (at Assets/Prefab/Testing.cs:11)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      Sounds like you forgot to drag a reference and are calling Instantiate(); on a null reference.

    • @SoulsElite
      @SoulsElite 4 роки тому

      You are missing the "Resources" folder. Put GameAssets prefab in there. it was not explained in this video.

    • @peterchow172
      @peterchow172 4 роки тому

      @@SoulsElite Hey, I tried this but it still doesnt work?

    • @peterchow172
      @peterchow172 4 роки тому

      @@SoulsElite OH NVM i got it i named it Game Assets instead of GameAssets...

  • @kita0731
    @kita0731 9 місяців тому

    I wonder which video discusses the script for the game asset.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  9 місяців тому +1

      The GameAsset class? It's basically just a singleton, I covered it a long time ago unitycodemonkey.com/video.php?v=7GcEW6uwO8E

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

    I cant find the video where you explain the game assets singelton!

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

      I made it here ua-cam.com/video/7GcEW6uwO8E/v-deo.html

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

    this is the most pro tutorial I've seen so far for creating programmatically animations, THANKS A LOT!

  • @SoapBoy__
    @SoapBoy__ 5 місяців тому

    Would you ever redo this tutorial in 3D space? This one doesn't translate well due to the fact that gameobjects are of different sizes so at further ranges you just can't read them

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 місяців тому

      You could calculate the distance from the camera to the visual and use that to modify the transform.localScale

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

    Nice tutorial! if u can help me, how can I do the same with a objectpool? to improve performance

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      You would just replace the Instantiate(); call with a function to grab an object from a pool, everything else would be the same.

  • @RedstoneHair
    @RedstoneHair 4 роки тому

    Code Monkey, can you make a tutorial for inventory item quantities text

  • @vc.2023
    @vc.2023 Рік тому

    Can you speak and act a little bit slower, I need to slow down the play speed in order to see the input. This is a tutorial man!😅

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

      Take your time and pause as much as you need, you are absolutely not expected to follow a tutorial in realtime, just like it took me way longer than 20 minutes to learn how to do this, it took me hours/weeks
      So just take your time and make sure you understand what you are doing, best of luck!

  • @exmarxgames
    @exmarxgames 5 років тому +4

    I keep getting a null error due to the Game Assets, I have tried make sure everything is like how yours is but I still get the nullpointer exception, help please!

    • @magictimm4090
      @magictimm4090 5 років тому

      I have the same Problem. Codemonkey can you reupload the project?

    • @exmarxgames
      @exmarxgames 5 років тому +10

      MagicTimm I figured it out, you need to create a Resources Folder and then have the GameAssets Game Object within there, he was trying to call the folder Resources to load the GameAsset object.

    • @magictimm4090
      @magictimm4090 5 років тому

      @@exmarxgames Thank you very much !

    • @linshu6141
      @linshu6141 4 роки тому +3

      Also always be sure to type if (_i == null) instead of if (_i = null). That was my problem :D
      Dumb fail xD

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

      @@exmarxgames thanks!

  • @mrezaperdana
    @mrezaperdana 5 років тому +2

    hey i wonder how you know wich code to use at wich situation? like how to learn/ what where to read the materials

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +1

      It's all about experience, I've been writing code for 20 years and with Unity for 6 years so when I think up a system I already know what elements I'm going to need to make it work.
      In this case I knew I could instantiate a prefab on top of the Enemy, change the colors of the TextMeshPro component and modify it's position and scale, then it's just the matter of implementing it.
      The only trick is to keep writing code and making things, the more you write the easier it gets.

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

    Everything seems to work fine EXCEPT getting the score to be where the mouse position is. I am in 3D and it doesnt seem to track its position. I have used the util.class and im not getting anything. Any ideas why this could be?

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

      How are you getting the mouse position? It's a different method in 3D ua-cam.com/video/0jTPKz3ga4w/v-deo.html

  • @MarkTheMadMan
    @MarkTheMadMan 4 роки тому +1

    Iam really struggling with the "GameAssets" class. I made it exactly how you did in this video but i just get an error "An object reference is required for the non-static field, method or property "DamagePopup.Create(Vector3, int)"

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Sounds like you didn't make the Create(); function static

    • @SoulsElite
      @SoulsElite 4 роки тому +4

      You are missing the "Resources" folder. Put GameAssets prefab in there. it was not explained in this video. Had the same problem.

    • @MarkTheMadMan
      @MarkTheMadMan 4 роки тому

      @@SoulsElite Yes i watched his previous video and it fixed it all, thanks!

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

    You should have AT LEAST pointed to the Game Assets handler video with a link instead of just mentioning it. Beside that good video.

  • @truongvantam4994
    @truongvantam4994 7 місяців тому

    I am facing issue that My popup is called to Hierarchy but it is hidden whether in 2d or 3d view of the scene window

  • @KeiNovak
    @KeiNovak 5 років тому

    Great tutorial but not a fan of the new intro video. Not to say that the video was bad, but it's more about intro videos in general. There is a reason that TV shows have shortened them and that Netflix has a Skip Intro button. Even more so for content like this that someone is just looking for a solution and not purely to be entertained. But again, tutorial was great...especially the explanations for each line... I'm thinking of applying it to one of my pet projects.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +2

      I fully get that and I did my best to try to keep it as short and concise as possible.
      However looking at my analytics 70% of the people watching the videos aren't subscribed which severely limits the growth of the channel. I can't keep running this channel at a loss forever so I'm trying something new to hopefully get the channel to a place where it becomes sustainable.
      Thanks!

    • @KeiNovak
      @KeiNovak 5 років тому

      @@CodeMonkeyUnity it's to be expected of this type of channel. People search for a solution to a problem they are having and you have a tutorial that helps. I don't see this channel as one of those that people come to looking to fill their time. I feel the tail end of tutorial videos are much longer so you may not get the hits up front, but you will further down the road.
      One thing that may help is to do a string of series that shows how to build games of multiple genres from A to Z. Like a series on RTS, one on FPS (I keep seeing people requesting endless runner tutorials), RPG, TPS, even online games (MMO would be a good keyword). That way people have an incentive to watch a string of videos giving you hits on the frontend, while also sticking true to the usefulness of the channel to unity ppl and of course maintaining that tailend.

  • @milesromanus7041
    @milesromanus7041 4 роки тому +2

    took me 4 hours for the first 7 minutes but ok

  • @omniscientomnipresent5500
    @omniscientomnipresent5500 5 років тому

    I wondered how it was made

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

    I wanted to do something like when the enemy is damaged it will show the damage popup as usual
    however if the enemy get's the same amount of damage in rapid succession then it will reset the disappearTimer and print the damage followed by x and the amount.
    For example: if enemy gets hit 30 times very fast for 2.5 damage it will print 2.5 x30.
    Really want to know how to do this, can you make an updated tutorial if you are feeling up for it?

  • @carlossrur5344
    @carlossrur5344 5 років тому +1

    Make a tutorial about how to make this game (full tutorial)

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      This scene isn't really a game, there's just the characters and the effect.
      You can browse the video list for the videos on Simple Character Movement and Bullet Tracer effect.
      ua-cam.com/play/PLzDRvYVwl53vXmpctKrMQTxA3cQwGcAk2.html
      ua-cam.com/video/jDiAzxkYzpI/v-deo.html

    • @carlossrur5344
      @carlossrur5344 5 років тому

      @@CodeMonkeyUnity wow thank you

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

    Hey CodeMonkey! Have your opinions on prefix files based on type changed over the years?

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

      In terms of using the "pf" prefix, nowadays I normally just add "prefab" to the end of the variable name.
      I started doing that because when people other than me are following a tutorial they might be confused as to what "pf" stands for so to avoid any confusion in the videos I just decided to switch that.

  • @ashmor4616
    @ashmor4616 5 років тому +1

    his keyboard is freaking me out

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

    Plz make unity 3d tutorials

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

      All my tutorials work both in 2D and 3D ua-cam.com/video/3zxTigjJr24/v-deo.html

  • @mechtarin
    @mechtarin 4 роки тому

    can we use animations for effects

  • @mrbananaman8032
    @mrbananaman8032 4 роки тому +1

    How did you get the text to draw without a canvas?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +3

      It's a World Text object, not UI Text, those are different classes

    • @mrbananaman8032
      @mrbananaman8032 4 роки тому

      @@CodeMonkeyUnity ahh ok, thank you!

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

    sortingOrder will overflow

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

      Yes and when it does it will loop back and everything will keep working as normal

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

    Is there any reason to return damagePopUp in the DamagePopUp script instead of just returning null? Love the videos by the way!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      On what function? The Create function does return the DamagePopup

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

      ​@@CodeMonkeyUnity at 6:25 in the Create function

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

    Unfortunately this doesn't work if you are on a smaller scale game because you get grey boxes around all the characters :(

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

      What grey boxes? Sounds like either your font size is too big or you just have no font assigned so you're just seeing empty quads. This element, like any element, can be scaled up or down

  • @just-qw9ge
    @just-qw9ge 5 років тому +1

    Please explain how to make game endlis runner

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому

      Yes it's on my list but not sure when, plenty of simple games and genres I'd love to do.

  • @322ss
    @322ss 5 років тому +1

    I haven't used TMPro, and based on your video it seems it is possible to use it without a canvas, just have the RectTransform in world space? Pretty neat, and probably more performant than having zillion World Space Canvases... but how about not having Canvas scaler? How would the text be scaling in this case? I understand this is demo, but do you use this approach in your own games? Thank you for the video like always!

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  5 років тому +1

      Yeah I'm still new to using TMPro so not too sure how they're using a RectTransform without a Canvas, I think the RectTransform is simply translating the Width, Height and Pivots into normal Transform coordinates.
      I haven't used TMPro in any of my published games since it has a bunch of issues when dealing with Asian languages, you need to create a atlas for each language and I haven't gotten around to figuring out how to sort that so Battle Royale Tycoon is using a normal TextMesh.
      The text seems to be scaling solely based on the Main Camera so it works just fine like a normal TextMesh.

  • @elcamp3
    @elcamp3 4 роки тому +1

    Not sure why, but when I finished up the 'Create' function, and I tried to do the damage testing, the pop-up failed to show up. I followed your instructions, but it just doesn't pop up.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Does anything show up? Make sure you're not instantiating a null object.
      Pause the scene and look at the hierarchy, maybe you're spawning objects with a weird Z position.

    • @elcamp3
      @elcamp3 4 роки тому +1

      @@CodeMonkeyUnity Nothing shows up at all. I also reset it to 0,0,0 and it doesn't pop up. Everything else before creating the 'Create' function worked the same as yours did.

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

    You're driving me insane with your Utilities that require a million packages.

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

      Why does that drive you insane? The opposite is what should drive you insane, if you write a million lines of code in a single class.
      You should write good clean code with as many classes as you need as decoupled as they can be so you can easily reuse them between projects.

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

      ​@@CodeMonkeyUnity I didn't mean your utilities but the packages that your utilities depend on, having to import packages that I won't use for my project. The first time I used your utilities was a while back, since I saw compiler errors I didn't want to fix them so I deleted the utilities and just moved on. I got errors again but after after looking at what I'm missing they went away. I just didn't feel like adding 1000+ files (including meta files) to get the damage popup working.
      Sorry if I caused some confusion.

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

      @@ronaldgameking2266 You can import everything onto a separate project to see how it all works, then grab just the scripts that are used, refactor them with your own code guidelines and then use them in your project

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

      @@CodeMonkeyUnity I did I removed stuff piece by piece and I ended up with 1 script

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

    Hi. I have an issue with the opacity fading. The floating text moves up fine, however, it goes to transparent instantly and doesn't fade slowly. I have copied your code step for step. Any ideas?

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

      Solved this by initialising the "textColor = textMesh.color;"
      and "disappeartimer = 1f" in the Start function

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

    doesn't work not matter what I tried... maybe I've done something wrong... keeps getting Error: The Object you want to instantiate is null

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

      You are calling Instantiate(); and passing in null as a parameter. Check where you're getting that parameter from, use Debug.Log to find what is null ua-cam.com/video/5irv30-bTJw/v-deo.html

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

    Did anyone have a problem with this rendering on the Scene tab, but not on the Game/Simulator tab? I'm doing a 2D non-scroller for mobile. Canvas is 1920 x 1080 and my Main Camera is positioned at the bottom left-hand corner 0,0 as recommended by some other tutorials. Instead of emitting the damage from enemies, I have a button that I'd like have emit the text popups when clicked. The pop-ups show in the Scene tab, but not in the game tab. I had the prefab done in 20-30 mins and I've then spent 6+ hours trying to figure out what I've done wrong. Thoughts? Long time developer and android dev for a few years, but I'm new to Unity.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      It shows up in Scene view but not game view? Perhaps it is spawning behind the camera? Check the Z position
      Or perhaps it's spawning on a certain Layer that is not being rendered by the main camera

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

      @@CodeMonkeyUnity Thanks for the reply! I found out that, as I was instantiating the prefab, I needed to assign it to a parent that was already on the canvas. Great video. You have me as a subscriber now.

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

    I followed until you actually implemented it on the aim handler script. I don't know how you created the GetPosition() function and passed it on .

  • @freecode.ai-
    @freecode.ai- 5 років тому

    I dont have sorting layer under extra settings.. When it shows up its behind everything. Mine says geometry sorting but it doesnt show my sorting layers to choose from, any idea why?
    Thanks for the videos!

    • @freecode.ai-
      @freecode.ai- 5 років тому

      Oops I was using text mesh pro UI

  • @gawer33
    @gawer33 4 роки тому

    I copy it correctly i don't know why it does not work perhaps because I'm on 3d.
    edit i made it work change my damage type from bool to if stament.

  • @Foxus_lol
    @Foxus_lol 4 роки тому +1

    Hello, I am getting an error in update function, especially in this line : textMesh.color = textColor; you are implementing this at 10:50, the script is working and everything is all right, however I am getting 60 error messages per second in console saying : NullReferenceException: Object reference not set to an instance of an object. Could you help me fix this please ?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому

      Sounds like you have your textMesh set to null, add some Debug.Log(); to find where it should have been set.
      Also in your console click the button that says Error Pause so your game pauses when you get an error

    • @Foxus_lol
      @Foxus_lol 4 роки тому

      @@CodeMonkeyUnity Ok I fixed it, problem was that my gameobject which was holding the script didnt contained TextMeshPro component.

  • @davdev793
    @davdev793 4 роки тому

    Pretty Nice! I've done a popup too in a 3d enviroment. My solution to have it over everything else was to have it's canvas in world space and 2 cams. One for the pop ups and the other for the game itself. Thing is the new URP dosent support camera stacking anymore. Any clean workaround? Had some folks telling to write a post process for this but feels like a overkill. Thanks in advance.

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  4 роки тому +1

      Camera Stacking has been added in the latest update!
      Possible workaround would be something using RenderTextures

    • @davdev793
      @davdev793 4 роки тому

      @@CodeMonkeyUnity oh you're right! Sadly I still can't have alpha to work on my popup camera anymore and it makes everything blue besides the numbers. Will check out RenderTextures. Thanks alot!

    • @davdev793
      @davdev793 4 роки тому

      It was actually a bug in the version i was using that the Alpha in the Solid color background in the camera settings wasnt working. Updated it and it's working fine now. Thanks again for the response !

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

    Why do you use Transform for pfDamagePopUp instead of GameObject? We instantiate game objects and transform is just one of its components. Why does it work?

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

      GameObjects and Transforms are pretty interchangeable because very Game Object has to have a Transform and every Transform has to be attached to a Game Object.
      So since you cannot have one without the other, instantiating a Transform or a Game Object does the same thing, the difference is just the return type on Instantiate();