Topic was automatically imported from the old Question2Answer platform.
Asked By
DinDinDin
Hello,
I’m making a game in VR and I need some text but i coun’t find any node that can help?
I need some flat text editable from the Godot UI or by code.
Anyone know some solution?
Sprite3D isused to display 2d pictures in 3d scene. I don’t thing you would by able to show the text using it. If you have the writing as png then it might work
Help me please | 2021-07-23 04:50
By using a ViewportTexture (with your text in a Viewport).
DinDinDin, sorry that it’s been a bit unclear.
Later on I’d like to give a proper answer for your question, but for now I have this project on Github, it is mostly irrelevant to the topic but it does have an example of a Sprite3D/Viewport text if you’d like to look into it:
Yuminous | 2021-07-23 05:46
Yep! it works great but also I think using viewport is good option for showing 3d health bars, levels of mob or anything else. But don’t think if it’s good for showing on UI. It would somewhat look like a blackboard (not really, just a comparison). That’s why I stated that.
Hi!
Is my way (the way i suggested) good or do it needs any improvement?
I use to do this without any error but I am wondering is this the best way.
Help me please | 2021-07-23 04:46
Help me please, using your method is perfectly OK for static UI. I use that myself for all my menus, but the important distinction here is that even the nodes are “in a 3D scene,” you’re actually displaying a 2D scene over your 3D one. It’s still a 2D scene and it acts like one.
For “in-world” 3D text elements (such as name tags), you would want the text to act like a 3D element by being anchored to a certain point in 3D space. You can estimate this point through the use of camera raycasting with Spatial node, essentially what Callinou was suggesting with the “3D Waypoints” tutorial.
However, that isn’t the perfect solution either, as the text element will not resize at all, no matter how far it is from the camera (without scripting).
For this reason, the ultimate in-world solution text is to use a 3D Sprite with a Viewport texture as Snail0259 was trying to suggest but with only half of the essential details and no instructions. The 3D sprite is an actual 3D element and its display is very intuitive for the game designer.
I hope it’s somewhat informative!
Yuminous | 2021-07-23 05:34
Thanks!
I am 70% noob that’s why I don’t know much.