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.