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?
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.
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.
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 :)
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!
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.
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.
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.
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.
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)
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.
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.
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.
@@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 :(
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 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....
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”
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.
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.
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
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
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?
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
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!
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
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.
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
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
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.
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.
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?
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.
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
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!
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!
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.
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.
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?
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)"
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.
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!
@@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.
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?
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
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.
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
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!
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.
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.
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.
@@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.
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.
@@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.
@@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
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?
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
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.
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
@@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.
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!
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 ?
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
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 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!
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 !
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?
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();
This was a really cool effect to make!
What other things would you add to it?
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?
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.
@@CasualCosta Turn base system would rock, add my vote too.
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.
I want to deal attacks to multiple enemy(1 shot 4 hit ,like that)
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 :)
u're my savior mate
Thanks!
@@4SheR Yeah it had my mind in bits for hours :D
Legend. Thanks man.
After hours of headaches, I was about to give up on this video. Really thank you very very much.
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!
I'm glad the video helped you! Best of luck with your game!
It’s crazy how often you have the exact videos that I’m looking for. So prolific.
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.
jesus?
This was exactly what i was looking for, thank you.
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.
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!
This was amazing! That's a lot!!
Highly underrated channel. It's one of the best gameDev channels I've found.
Thanks!
It's not very popular because he codes at mach 10 speed and no one can understand his complicated scripts.
@@beri4138 ok boomer
@@Zac_Bacs ok zoomer
why you lying???
Your ad brought me here. This was the First usefull commercial ive ever saw
Glad you like what you see!
This is pure gold, i think this would benefit from the getcustomdir function of yor utilities, maybe some easing on the transition.
Is that intro new? Its the first time i noticed it, it looks really nice.
Yeah trying out a couple of new things, glad you like it!
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.
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.
You're the best. Really, I did not believe I could implement that so easily !
Instantly subscribed after this , and added to my RPG Game!!!
this really helped me with my game mane, thanks a lot for the tutorial much appreciated
Keep up the good work... thanks 🙏🏻
Great for me....learning game dev so doing platformer not straight 3d
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)
@@indieprogress7170 yeah
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.
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.
Do you have a Patreon or similar page for donations? I didn’t see one on the website.
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.
@@CodeMonkeyUnity Done!
Ppl trying to follow your guide but the speed is crazy and valuable step could be missed even using pauses
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.
@@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 :(
Great video and explanation!
Thanks!
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.
You can even combine it with custom fonts to make it crazier ua-cam.com/video/nBcP7FaDPE0/v-deo.html
@@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....
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”
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.
Yeah the animation of the popup could certainly be done with a AnimationClip.
UNDERRATED videogames developing channel.
You are a beast and surely deserve more views per video.
Thank you and greetings from Argentina.
Thanks!
NICE zoom in on the text! (Make its snap and easier to see in Visual Studio)
Thanks! Trying out some new things.
Just discovered your channel ! Quality content very well explained! Continuous like that!
Glad you like what you see!
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.
Should also make a tutorial on a tutorial dialogue, where some text teaches the player to navigate through menus
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
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
It gives me an error with the gameasset one
Create a folder names Resources, put your prefab named GameAssets in that folder
I put like first blindly for cz I knw u always give good one 😂😍
Thanks!
Another great video. Thanks
Thanks you! It was very helpful for me!
I find this very useful thx 👌
Thanks so much!
Bro your chanel is like a holy grail for me
Glad to hear it!
Thank you!
Great. You are a pro with programming and unity!
Very helpful, thanks! :)
This channel so help me grow my game developer skill. Cool !!
Glad to hear that! It's my goal with this channel!
Thank u for the video
Thanks, great
thank you
This video is great! Helped me a lot!
Is someone have the link to the video explaining more about the GameAssets class ?
Its here ua-cam.com/video/7GcEW6uwO8E/v-deo.html
Thanks !! You are the best ♥️
@@CodeMonkeyUnity Thanks I was looking for this as well
Amazing! Thank you!
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?
Welp, trying to figure out the whole resources thing ended up screwing my project's directory so that's great
How so? You just create a folder anywhere called Resources, that's all
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
nice video
Very nice pro
Would love to see a tutorial on how to do some of the effects applied in JuiceFX programmatically in Unity.
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!
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
awesome method CM .. But I am curious that the same effect can be made with the UI Canvas sys ??
If you couldn't spawn the text where you click and you're in 3D project, try changing it into 2D one.
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
Nice
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
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.
You are missing the "Resources" folder. Put GameAssets prefab in there. it was not explained in this video.
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
@@SoulsElite thx man
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
What error messages? You just need to call the DamagePopup.Create(); function
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.
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.
I cannot type that quickly....
nice tutorial, you dont need to fast forward the clip though it makes it very hard to follow
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?
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.
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)
Sounds like you forgot to drag a reference and are calling Instantiate(); on a null reference.
You are missing the "Resources" folder. Put GameAssets prefab in there. it was not explained in this video.
@@SoulsElite Hey, I tried this but it still doesnt work?
@@SoulsElite OH NVM i got it i named it Game Assets instead of GameAssets...
I wonder which video discusses the script for the game asset.
The GameAsset class? It's basically just a singleton, I covered it a long time ago unitycodemonkey.com/video.php?v=7GcEW6uwO8E
I cant find the video where you explain the game assets singelton!
I made it here ua-cam.com/video/7GcEW6uwO8E/v-deo.html
this is the most pro tutorial I've seen so far for creating programmatically animations, THANKS A LOT!
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
You could calculate the distance from the camera to the visual and use that to modify the transform.localScale
Nice tutorial! if u can help me, how can I do the same with a objectpool? to improve performance
You would just replace the Instantiate(); call with a function to grab an object from a pool, everything else would be the same.
Code Monkey, can you make a tutorial for inventory item quantities text
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!😅
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!
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!
I have the same Problem. Codemonkey can you reupload the project?
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.
@@exmarxgames Thank you very much !
Also always be sure to type if (_i == null) instead of if (_i = null). That was my problem :D
Dumb fail xD
@@exmarxgames thanks!
hey i wonder how you know wich code to use at wich situation? like how to learn/ what where to read the materials
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.
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?
How are you getting the mouse position? It's a different method in 3D ua-cam.com/video/0jTPKz3ga4w/v-deo.html
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)"
Sounds like you didn't make the Create(); function static
You are missing the "Resources" folder. Put GameAssets prefab in there. it was not explained in this video. Had the same problem.
@@SoulsElite Yes i watched his previous video and it fixed it all, thanks!
You should have AT LEAST pointed to the Game Assets handler video with a link instead of just mentioning it. Beside that good video.
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
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.
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!
@@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.
took me 4 hours for the first 7 minutes but ok
I wondered how it was made
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?
Make a tutorial about how to make this game (full tutorial)
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
@@CodeMonkeyUnity wow thank you
Hey CodeMonkey! Have your opinions on prefix files based on type changed over the years?
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.
his keyboard is freaking me out
Plz make unity 3d tutorials
All my tutorials work both in 2D and 3D ua-cam.com/video/3zxTigjJr24/v-deo.html
can we use animations for effects
How did you get the text to draw without a canvas?
It's a World Text object, not UI Text, those are different classes
@@CodeMonkeyUnity ahh ok, thank you!
sortingOrder will overflow
Yes and when it does it will loop back and everything will keep working as normal
Is there any reason to return damagePopUp in the DamagePopUp script instead of just returning null? Love the videos by the way!
On what function? The Create function does return the DamagePopup
@@CodeMonkeyUnity at 6:25 in the Create function
Unfortunately this doesn't work if you are on a smaller scale game because you get grey boxes around all the characters :(
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
Please explain how to make game endlis runner
Yes it's on my list but not sure when, plenty of simple games and genres I'd love to do.
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!
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.
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.
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.
@@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.
You're driving me insane with your Utilities that require a million packages.
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.
@@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.
@@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
@@CodeMonkeyUnity I did I removed stuff piece by piece and I ended up with 1 script
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?
Solved this by initialising the "textColor = textMesh.color;"
and "disappeartimer = 1f" in the Start function
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
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
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.
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
@@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.
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 .
It just returns the transform.position
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!
Oops I was using text mesh pro UI
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.
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 ?
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
@@CodeMonkeyUnity Ok I fixed it, problem was that my gameobject which was holding the script didnt contained TextMeshPro component.
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.
Camera Stacking has been added in the latest update!
Possible workaround would be something using RenderTextures
@@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!
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 !
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?
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();