+1 vote

I am making a shooter, and I want my vehicle to have a cool 3D HUD. Instead of having a main hud that is displayed on top. I set it up, You can see it in the editor. I hit play, does not work.

It fails to save too. I know the viewport texture can display to the mesh. I can see it in scene. What is turning my texture black?

Here's the source code.
https://gitgud.io/lavaduder/pyrofly

in Engine by (266 points)
edited by

2 Answers

+1 vote

Okay so I fixed it. by changing the Meshinstance to a Sprite3D.

(Not sure Why this happens still. So I'm not going to say this is the answer. So feel free to explain.)

by (266 points)

This is really the one and only thing that helped me, thank you so much <33

(still helpful after 4 years lmao)

+1 vote

If the shader you're using isn't set to be local to the scene, the Viewport texture will work in the editor (for some reason? I can't tell why) but at runtime it'll try to find the viewport from the root of the tree, making the path wrong. If you set both the Viewport Texture and shader to be local to the scene, it'll work.

(ik this is three years old but im putting it here so the next person who needs to do this can find the answer on google instead of going round in circles being stuck for two hours like i did)

by (16 points)

Did not work for me, but maybe I am doing something different.

I am digging in this for more than an hour and it just doesn't make any sense. I tried to change the MeshInstance to Sprite3D though and it works perfectly, even fitted the size of the Viewport.

This is 4 years old now and still confusing.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.