0 votes

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.

in Engine by (260 points)
edited by

2 Answers

0 votes

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 (260 points)
0 votes

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 (14 points)
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.