Godot Version
v4.2.1.stable.official
Question
hello, i was wondering if anyone could help me with a problem I’m having.
see, i have applied a texture in the 3D editor to a piece of land (a MeshInstance3D with staticBody3D and collisionShape3D children) and the texture shows up fine in the 3D editor, but when i run the scene, i spawn in and there is no texture. the rest of the game runs fine and there are other objects with textures that loaded fine, it’s just the land that wont load a texture.
I’ll add links to a folder with the game files below.
Game_Files
how did you add the texture
I dragged and dropped a PNG file onto a meshInstance3D
the texture is 2.62MiB and is a compressedTexture2D
this is the texture below:
and the object the texture is being applied to is an OBJ file (which is a meshinstance3D node in the scene) and is 398.6 KiB.
does this help at all?
btw, this is for a school project so I don’t know a lot about the engine so I am trying to give as much detail as possible.
At least every time I added a texture to a meshinstance I first had to add a standard material, then added the texture to the albedo.
The standard material sets up an internal shader script that will take the texture under the albedo and draws it to the mesh using the UV map of the mesh.
So I’m not sure how to drop the texture onto a mesh without first applying a material.
Could you provide a snapshot of the meshinstance inspector?
The other thing it could be is that in the editor preview, there is a camera, light source and wold environment added in the background, but does not carry through into running the scene.
Do you have your own scene camera world environment and light source added to your scene?
yeah. so the thing is that the actual mesh has its own scene and that is where i add the texture and then i instantiate the scene into the main ‘level’ scene with all the other objects. I have an environment and a camera in the scene.
I have a feeling it might be something to do with the way I add it to the main level because all the other objects i added have working textures.
here is a screen capture of where I am at.
Edit: i fixed it somehow by simply re-adding the texture to show one of my mates and it worked for some reason. its showing in the editor and in game. i still have no idea what caused it and would like to know if anyone knows why it happened in case it happens again but for now, we chillin.
thanks guys!