Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

My game throws a weird error— "get_height: Viewport Texture must be set to use it"

A topic by Kasper Hviid created Jul 14, 2024 Views: 370 Replies: 4
Viewing posts 1 to 4
Submitted

Luckily, the game seems to run fine despite the error. But I'd like to get rid of it.

E 0:00:02:0239   get_height: Viewport Texture must be set to use it.
  <C++ Source>   scene/main/viewport.cpp:137 @ get_height()

E 0:00:02:0239   get_width: Viewport Texture must be set to use it.
  <C++ Source>   scene/main/viewport.cpp:127 @ get_width()

This is where the error happens, apperently:

https://github.com/godotengine/godot/blob/b09f793f564a6c95dc76acc654b390e68441bd...

I guess I must have done something—but I'm unsure what it is.

Submitted (2 edits)

My game does the same. Did you use the XR template ( https://github.com/GodotVR/godot-xr-template ) for a menu screen? I think there is a viewport width and height setter in their menu scene. That seems to be the root of my issue, although I never fully solved it, only tracked it down. 

Submitted

No, never used that one. But my game does have some screen you can interact with via Viewport-2D-in-3D

Submitted

Yeah i think its an issue with the 2d in 3d viewport thing, i set mine on ready so it updates correctly and that might be why?  not sure

HostSubmitted(+2)

Its a funky order thing when using ViewportTextures, where the size isn't known in time. It should resolve itself after a single frame and you can thus ignore it.