godot

How do I fix weird positioning of textures in Godot?


Size of mesh is at 128

I created a Meshinstance and set the texture to the default "icon.svg" file. But it is weirdly cut off. Changing the size of the mesh does not help. It just remains oddly cut off, rotated, and does not make sense. Help would be much appreciated. Second Image


Solution

  • This weird behaviour arises because you're adopting an erroneous workflow. From the docs:

    Currently, the only way to generate a 2D mesh within the editor is by either importing an OBJ file as a mesh, or converting it from a Sprite2D.

    Instead of creating a Mesh2D manually, you should first add a Sprite2D to your scene, then convert it to a Mesh2D using the toolbar controls above the editor viewport:

    Godot editor menu to convert a Sprite2D into a Mesh2D

    Please refer to the official tutorial to learn more about conversion parameters and intended use cases.