Not only this is a very clear tutorial, but I like that it shows the bottom-up process of coming up with ideas of what effects to apply next so it will look good. Instant subscribe!
Excellent tutorial! I've learnt some neat tricks from your videos so far. For anyone having trouble with this text not facing the camera, just pop the below into your LateUpdate function on the floating text script: var cameraToLookAt = Camera.main; transform.LookAt(cameraToLookAt.transform); transform.rotation = Quaternion.LookRotation(cameraToLookAt.transform.forward); Now the text will always face the camera. Just something I learnt somewhere else that I hope helps somebody here :)
I was looking for a tutorial to place text over a 3D Object like "Press x to pickup". But wow. I sat and watched the whole tutorial because of how amazing you teach. The way you added new features step by step. Definitely liked and subscribed.
Great tutorial quick and to the point, none of this I have to talk, make silly jokes and try to sound cool for 20mins before showing you anything, great job!
Amazing flow in this tutorial. I'm a complete noob when it comes to Unity (and game development in general) so I didn't get most of it, but your editing is impressive!
Now in days a person would probably want to use the Text Mesh Pro Component instead of just an ordinary Text Mesh. It'll have much higher resolution and more options. Everything is essentially the same but you'll have to use something more like this var text = Instantiate(FloatingText, transform.position, Quaternion.identity, transform);
text.GetComponent().SetText(currentHealth.ToString()); As opposed to 2:15
How would we make the text always face the player even if the enemy is not initially facing him and we are using a Cinemachine FreeLook camera...anyone? Thanks for the video by the way, great stuff!
from where I can get the project files of the TH-cam Tut "Popup Text with Unity" from 2018? the referenced link to the asset store tell me "Unfortunately, Survival Shooter Tutorial [LEGACY] is no longer available" !
When I do this, I got MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it. It seems the timer script is destroying not the instance but the prefab itself. And the next time you call "Instantiate" the floatingTextPrefab is NULL.
Very well presented. And appreciate your explanations. Coming from Flash/AS3 and a long time in-between... getting aboard the programming and animation scene again. What would you do to get the color of the enemy. Which is what popped into my head immediately. Shoot enemy: enemyColor = getColor(Object enemy). I'm noob to Unity and C#.
Nice tutorial, but can you tell me why when I modify the position in the animator it seems that it uses global coordinates, instead than local as in your example? I mean in the animator editor if I tell the vector to goes from (0,0,0) to (0,1,0), it goes outside the screen ,using world values (0,0,0) instead of local values on the game object ?
Usually most of the animator issues occur due to parenting issues (-_- *pun) Make sure that the relevant components are child of the animator properly. Also confirm if you are not setting the position from some script as well that might cause collision.
@@IndieNuggets Well, if my parent object is being destroyed by my command. In this case, How do I determine the position of the text after the destruction according to the parent object ?
Is there any way to keep the text static instead of having it rotate with the models? I'm trying to use this in 2D but as soon as a sprite flips, the text pops up reversed and there's no way to set it back to normal because animations (which can't be edited during runtime?) override the localScale of the instantiated gameObject.
@@IndieNuggets I too am trying to figure that one out. Would be cool if you could do a small video on how to achieve that glow on text. Making the "idle" in 3d would be cool too.
i've been trying to implement this into my 2D game project, but for some reason, it instantiates, but the text hides behind everything, i've tried changing the pos z, the sort order, as well as some settings, but just doesnt seem to want to appear in front instead of the back :(
How can we add glow to the text like in the video?
5 ปีที่แล้ว
My favorite tutorial about floating text, but I do not know how to make it visible in a 2D game. Can you please tell me the steps? Thank you in advance!
In 2D your text might be going behind the camera or other objects. Try to make sure you don’t animate the z value of text. Also just swich unity scene view to 3D to check if your text is correctly positioned.
5 ปีที่แล้ว
@@IndieNuggets I don't have any animations yet. I've just created an empty game object and i've attached the text mesh component to it. When switching the scene to 3D, it is visible, but when I switch back to 2D it is not. My main camera is set to -1 on the z axis.
It’s hard to say what might be the issue. Try to check the image sort order, make sure text is not behind the camera, also the text rotation is correct. Or maybe try using different text like the UI text and see what happens. Just experiment :)
5 ปีที่แล้ว
@@IndieNuggets Ok. Thanks anyway! I'll figure out a way. 🖐️😎
Hmm. Hard to say what the issue is. It might be some animation which could override any position. If that’s the case then try putting the TMP pro component as a text of animator component.
Great tutorial! ..but when I try to animate the text floating up in a 2D project, the animation causes the Text to be locked to y = 0 and then rise up to 0.5, when it should be in relation to the object hit (that might be at something like y = 3, but the text still shows at y = 0 - 0.5). :(
Hello sir! Great tutorial. But I'm just having a problem with the slide up animation, the animation doesn't follow the enemy but it just slides up to the coordinates (0, slide up value, 0). do you have an idea how to fix it?
@@IndieNuggets Thanks for your fast reply. I actually fixed it by toggling the "Apply Root Motion" in the animator section of the Floating point prefab
@@IndieNuggets When I change the xyz coords on one set of keyframes it changes them for all keyframes at the same time. I can't set individual values for individual keyframes.
I’m using the 3D text here instead of UI text which doesn’t require a canvas. If you are using UI text then you have to make sure the text doesn’t move in z axis or else it will disappear.
Ah my bad accent 😅. I meant “Object Pooling” it’s a way to reduce the number of game objects by reusing the older ones. Currently we are creating new Text objects for every score which can get slow if there are a lot of them. To fix that we can pool the objects and reuse them. Look for “Unity object pooling “ to know more. 👍
Not a good tutorial. "instantiate" has a short lag, which can be very critical with a lot of popup messages. If you making a game like "Vampire survivors" you will have terrible lags because of creating hundreds of new gameObjects every second. Throw a prefab of stone at me if I'm wrong.
There was a glow shader included in the project. But newer unity versions have changed shader pipeline so that won’t work anymore. Try using any glow shader or bloom effect.
Not only this is a very clear tutorial, but I like that it shows the bottom-up process of coming up with ideas of what effects to apply next so it will look good. Instant subscribe!
Great tutorial, quick and to the point. Good job.
There are tutorials out there that take 20 minutes to convey the same feature.
Thanks for making it short and informative.
Excellent tutorial! I've learnt some neat tricks from your videos so far. For anyone having trouble with this text not facing the camera, just pop the below into your LateUpdate function on the floating text script:
var cameraToLookAt = Camera.main;
transform.LookAt(cameraToLookAt.transform);
transform.rotation = Quaternion.LookRotation(cameraToLookAt.transform.forward);
Now the text will always face the camera. Just something I learnt somewhere else that I hope helps somebody here :)
thanks proo aloot
Thank you!
My savior!
that was one of the best tutorials I've ever seen
great job man 👏👏👏👏👏
Five years later, your tutorial is still as helpful and clear! Thank you for making it and sharing your skills!
Now THIS, is a great indie nugget here, short, sweet, and very clearly to the point. GREAT video!!
and today is the first time I've ever watched a tutorial and not had to set it to 1.5 or 2 times speed XD love it! 10/10
I was looking for a tutorial to place text over a 3D Object like "Press x to pickup". But wow. I sat and watched the whole tutorial because of how amazing you teach. The way you added new features step by step. Definitely liked and subscribed.
Great tutorial quick and to the point, none of this I have to talk, make silly jokes and try to sound cool for 20mins before showing you anything, great job!
even after 6 years, this is a great tutorial dude!
That is one of the best tutorials I've ever watched. Thank you. You just earned a new subscriber
Most people have already said it, but tutorials need to be more like this - very to the point.
Ty very much.
One of the best tutorials i've ever seen, congratulations and thanks
Wow. The most to the point tutorial I have EVER seen. Instant subscribe!
I just saw a video of someone explaining this in 40 minutes, yet it was not even half as good. Great job mate
Awesome tutorial! Liked the whole approach of building up the effect gradually.
Great quick and clean tutorial, keep up the good work.
I had been struggling with this for hours, and you helped me figure it out in 6 minutes!
Thanks a bunch for this, it's always great when a video shares this much knowledge in a limited amount of time.
still the best floating text tut in 2022
Amazing flow in this tutorial. I'm a complete noob when it comes to Unity (and game development in general) so I didn't get most of it, but your editing is impressive!
This is a great tutorial! This is a way shorter and quicker to the point than the other tutorials on this
Nice tut, absolutely love your speed!
Best tutorial ever man xD just subscribed to your channel looking up for more.
Subbed!! What a great and clearly explained tutorial. Thankyou!, now to binge watch the rest of your content lool.
Thanks for this quick and forward tutorial! Helped me a lot!
Excellent! Exactly what I needed, and you were so to the point, I got what I needed in the first 2 minutes. Thanks!
Now in days a person would probably want to use the Text Mesh Pro Component instead of just an ordinary Text Mesh. It'll have much higher resolution and more options.
Everything is essentially the same but you'll have to use something more like this
var text = Instantiate(FloatingText, transform.position, Quaternion.identity, transform);
text.GetComponent().SetText(currentHealth.ToString());
As opposed to 2:15
Good idea but it will need canvas, and if you are adding many texts that will be performance killer because there will be many canvas in objects
very helpful, concise and quick. great video
Really great tutorial. It is short but it covers all the key points. :)
Thank's a lot for this great tutorial! :) Stupid question, though. How did you get your text glowing?
This really helped me with working on a group project. Many thanks!
This tutorial is so on point and clear af!!!
Oh my god this was the game I saw moist critikal play LMAO
using text mesh pro-text helps out a lot. can put a text mesh in the 3d space. never would've thought of it without this, thanks!
How would we make the text always face the player even if the enemy is not initially facing him and we are using a Cinemachine FreeLook camera...anyone? Thanks for the video by the way, great stuff!
Amazing! Second thing to exactly what i was looking for....Thank you... Subscribed!
Great tutorial. Thanks a lot! Quick and easy to follow.
from where I can get the project files of the TH-cam Tut "Popup Text with Unity" from 2018? the referenced link to the asset store tell me "Unfortunately, Survival Shooter Tutorial [LEGACY] is no longer available" !
Grate tutorial. A guild directly, and clean that tutor to aim.
Solve a question that burdens me a long time.
When I do this, I got
MissingReferenceException: The object of type 'GameObject' has been destroyed but you are still trying to access it.
It seems the timer script is destroying not the instance but the prefab itself. And the next time you call "Instantiate" the floatingTextPrefab is NULL.
Fantastic stuff man. Thank you
ty. used it as damage inducator but your tutorial did the job xD
Love this tutorial! Question would this work with the new UI with Canvas?
What is the font of your code editor? so beautifull!
Very well presented. And appreciate your explanations. Coming from Flash/AS3 and a long time in-between... getting aboard the programming and animation scene again. What would you do to get the color of the enemy. Which is what popped into my head immediately. Shoot enemy: enemyColor = getColor(Object enemy). I'm noob to Unity and C#.
Thank you!! Great content. I subbed 💯
Brilliant tutorial.
this tutorial is Awesome thank you!
i just subscribed
Excellent tutorial
Why its working only without last transform in Instantiate?? 1:23
Last transform is the parent. Maybe yours doesn’t need one.
@@IndieNuggets I figure out its working with last transform but text is extra small, like parent change it :/
Excellent video thanks so much!!
Hey , great tutorial but can we use this in 2d game , as textmesh automatically creates a mesh renderer and not a sprite renderer
Nice tutorial, but can you tell me why when I modify the position in the animator it seems that it uses global coordinates, instead than local as in your example?
I mean in the animator editor if I tell the vector to goes from (0,0,0) to (0,1,0), it goes outside the screen ,using world values (0,0,0) instead of local values on the game object ?
Usually most of the animator issues occur due to parenting issues (-_- *pun)
Make sure that the relevant components are child of the animator properly.
Also confirm if you are not setting the position from some script as well that might cause collision.
and it was effectivly a parenting issue :/ The object wasn't a child of any object so, it was positionning to the world .
Thanks again :D
@@IndieNuggets Well, if my parent object is being destroyed by my command. In this case, How do I determine the position of the text after the destruction according to the parent object ?
Just store it in some variable before calling destroy
@@IndieNuggets can you show me how i can fix the problem?
That is a good tutorial. Thanks!
Is there any way to keep the text static instead of having it rotate with the models? I'm trying to use this in 2D but as soon as a sprite flips, the text pops up reversed and there's no way to set it back to normal because animations (which can't be edited during runtime?) override the localScale of the instantiated gameObject.
Just don’t make the text children of the models if you don’t want them to move together.
Fantastic video!! How you add the glow effect to the text?
I think it was a glow shader included in the sample project.
@@IndieNuggets I too am trying to figure that one out. Would be cool if you could do a small video on how to achieve that glow on text. Making the "idle" in 3d would be cool too.
i've been trying to implement this into my 2D game project, but for some reason, it instantiates, but the text hides behind everything, i've tried changing the pos z, the sort order, as well as some settings, but just doesnt seem to want to appear in front instead of the back :(
Hmm. I’ve never used a 3D text in a 2d game. Did you check the inspector for the text? What does the position value for Z say ?
@@IndieNuggets by default, everything is pos z at 0, i've set it to negative values or positive values, both didnt seem to change a thing
When you instantiate it you are probably setting the Z value incorrectly. Try to instantiate with initial position where Z is in front
Hey, my transform.localPosition is not working, kindly help please!
How can we add glow to the text like in the video?
My favorite tutorial about floating text, but I do not know how to make it visible in a 2D game. Can you please tell me the steps? Thank you in advance!
In 2D your text might be going behind the camera or other objects. Try to make sure you don’t animate the z value of text. Also just swich unity scene view to 3D to check if your text is correctly positioned.
@@IndieNuggets I don't have any animations yet. I've just created an empty game object and i've attached the text mesh component to it. When switching the scene to 3D, it is visible, but when I switch back to 2D it is not. My main camera is set to -1 on the z axis.
It’s hard to say what might be the issue. Try to check the image sort order, make sure text is not behind the camera, also the text rotation is correct. Or maybe try using different text like the UI text and see what happens.
Just experiment :)
@@IndieNuggets Ok. Thanks anyway! I'll figure out a way. 🖐️😎
how to rotate text towards camera if fpp mode?
i've tried to make this but using textmesh pro, the problem is that it doesn't instantiate at the enemy's position
can you help me with this?
Why it doesn’t instantiate at player? Are you sure you are using TMP PRO text and not TMP Pro UI text ?
Thanks for the reply ^^
Yeah, I made sure that I am using TMPro, it always instantiates at the last position I edited the prefab in.
Hmm. Hard to say what the issue is. It might be some animation which could override any position. If that’s the case then try putting the TMP pro component as a text of animator component.
Hi! Sorry, I know I'm quite a few years late. But, does anyone know why my floating text only instantiates once in my scene?
great tutorial
Very nice tutorial, will it work with different resolutons on mobile platforms?
Yeah it should work well as long as we scale the resolution based on screen size. And in worst case you can make some minor adjustments on 3D text
Great tutorial!
..but when I try to animate the text floating up in a 2D project, the animation causes the Text to be locked to y = 0 and then rise up to 0.5, when it should be in relation to the object hit (that might be at something like y = 3, but the text still shows at y = 0 - 0.5). :(
If you make the text a child of object it will move together with it.
@@IndieNuggets Woah, that was a fast answer! Thank you so much!
Hello sir! Great tutorial. But I'm just having a problem with the slide up animation, the animation doesn't follow the enemy but it just slides up to the coordinates (0, slide up value, 0). do you have an idea how to fix it?
Make the instantiated “animated” text a child of the enemy. That way it’ll move with the enemy.
@@IndieNuggets Thanks for your fast reply. I actually fixed it by toggling the "Apply Root Motion" in the animator section of the Floating point prefab
I didn't see you actually change the scale. What are you doing when you're moving the keyframes and saying increasing decreasing scale?
Just changing the Scale.x scale.y values. (On the left side in property window we can change the values)
@@IndieNuggets When I change the xyz coords on one set of keyframes it changes them for all keyframes at the same time. I can't set individual values for individual keyframes.
Thx, really good nuggies
Where can i find tutorial of this games?
How are you doing this without a canvas? Isn't a canvas required? I tried you technique and the text is invisible, nothing shows...
I’m using the 3D text here instead of UI text which doesn’t require a canvas.
If you are using UI text then you have to make sure the text doesn’t move in z axis or else it will disappear.
Awesome Tutorial
OMG, tutorial is great but speed is rather too fast for me, I need to speed it down when watching!
Hey, I think the first, not-bouncy, effect was better.
Great-looking game you got there in the making!!! Did you launch it yet?
Hey Gustavo
It’s not my game. It’s a unity sample game (top down shooter)
Just used it for the tutorial :)
Oh, I see!
Nice choice then, very pleasing to watch with this sample
how do I change the color using script??
Great tutorial
i am not understand why you use white background when you code , you are alien
added to watch list maybe used it later
when it destroys the prefab it no longer has an object to instantiate
Do you mean the text prefab? You don’t really destroy the prefab. Just instantiate it
@@IndieNuggets Ahhh, the text is instantiating as red Xs, maybe i need to instantiate to the canvas?
@@JohnTheYetiBeast Maybe try using the "3d text mesh" instead of the canvas ui text.
How does this work with text mesh pro?
How is that font glowing so much? Can anybody point me how to achieve it?
How come yours is glowing?
could you please elaborate on object boolean, I would appreciate it, thanks
Sorry what do you mean by object Boolean?
thank you for your reply, I misspelled, "object pulling" 6:22
Ah my bad accent 😅.
I meant “Object Pooling” it’s a way to reduce the number of game objects by reusing the older ones. Currently we are creating new Text objects for every score which can get slow if there are a lot of them. To fix that we can pool the objects and reuse them. Look for “Unity object pooling “ to know more. 👍
Not a good tutorial. "instantiate" has a short lag, which can be very critical with a lot of popup messages. If you making a game like "Vampire survivors" you will have terrible lags because of creating hundreds of new gameObjects every second. Throw a prefab of stone at me if I'm wrong.
this is where object pooling would come into play, this isnt meant as a commercial grade solution
Great tut
How did you get the font to glow like that?
There was a glow shader included in the project. But newer unity versions have changed shader pipeline so that won’t work anymore. Try using any glow shader or bloom effect.
Nice tutorial
Hey man which renderer did you use to achieve this look? HDRP or URP?
pro...Very efficient video
very nice. subscribed, favorited, etc
That’s a shiny umbra lol
nice tutorial.
Cool tutorial but it's so fast I could not follow it even rewinding it 50 times. If you slowed it down a little it would be MUCH easier to follow!
Outstanding!!!
Thanks For your Tut...
that's called announcers
This is a bad method because on android instantiating and destroying causes garbage and then that later causes a lag.
uhmm how do you make that text glow
You can add any glow shader to the text material. Or adding a bloom in post processing might also give similar results