Hello.
I sucessfully made a 3D text in the editor, it displays correctly there.
However, when I start the game, the mesh instance just renders a black texture.
Does anyone know what is going on?
Hello.
I sucessfully made a 3D text in the editor, it displays correctly there.
However, when I start the game, the mesh instance just renders a black texture.
Does anyone know what is going on?
Yeah. Working with viewports can sometimes be a pain. I should know. I still haven't totally figured out why it sometimes doesn't work. :( Fortunately, I already did the hard work. Have you considered using a plug-in? https://godotengine.org/asset-library/asset/419
Got a light in that text scene? Or does it have emissive material or anything?
Thanks for all the answers.
Today when I fired godot back up, ready to do some gamedev, I noticed that the text in the editor now gone all black.
Also, I tried importing the 3D text plugin, but it seems to have issues when using a custom font, the text got strange shapes and looks really weird.
There's a perfectly good explanation for this. The font size is too low! If you look at the default font in the addons folder, you'll notice that the font size is 100. Your font size probably 16. By font size, I mean the variable in the font resource itself.
Ok so I fiddled around a bit with different settings, I got it working for a while, but suddenly for some reason I got black screen again (hence this time it was yellow because I had a yellow emission on my texture to make my font glow).
And now it is even worse, now it seems like textures is not displayed in the editor, but works fine in the game...
Does anyone have similar experience?
How are you getting the texture from the Viewport? I have found that using GDScript is the most reliable way to have a ViewportTexture working in-game. You might be able to get it working in the editor as well by adding tool
before the extends line.
I generally do something like this (written from memory):
# Assuming this script is on the MeshInstance node
# If you want it to run in the Godot editor, then uncomment this line, and then
# close and reopen the scene to refresh the script.
# tool
extends MeshInstance
export (NodePath) var path_to_viewport = null
var _viewport = null
func _ready():
if (path_to_viewport != null):
_viewport = get_node(path_to_viewport)
get_surface_material(0).albedo_texture = _viewport.get_texture()
else:
print ("Path to Viewport not set in ", name)
I'm not sure if it will help, but that is how I've always handed placing a ViewportTexture on a MeshInstance node in Godot.
@TwistedTwigleg said: How are you getting the texture from the Viewport? I have found that using GDScript is the most reliable way to have a ViewportTexture working in-game. You might be able to get it working in the editor as well by adding
tool
before the extends line.I generally do something like this (written from memory):
# Assuming this script is on the MeshInstance node # If you want it to run in the Godot editor, then uncomment this line, and then # close and reopen the scene to refresh the script. # tool extends MeshInstance export (NodePath) var path_to_viewport = null var _viewport = null func _ready(): if (path_to_viewport != null): _viewport = get_node(path_to_viewport) get_surface_material(0).albedo_texture = _viewport.get_texture() else: print ("Path to Viewport not set in ", name)
I'm not sure if it will help, but that is how I've always handed placing a ViewportTexture on a MeshInstance node in Godot.
Thanks, since I am new to Godot, it took me quite a while to figure out, but I think you are right because I get these error:
I will try your solution tomorrow.
@Cflow said: Ok so I fiddled around a bit with different settings, I got it working for a while, but suddenly for some reason I got black screen again (hence this time it was yellow because I had a yellow emission on my texture to make my font glow).
And now it is even worse, now it seems like textures is not displayed in the editor, but works fine in the game...
Does anyone have similar experience?
Are your talking about the plugin or your previous setup. If the plugin, could you be so kind as to leave an issue in the repository?