Defold 3D editor is difficult to use? Need Help (SOLVED)

Hello everyone. I am working on a 3D game but I cannot focus on the game because I do not understand the editor at all. I have this GO with Rifle model component on it, but to make it visible on camera, I have to move it down to the point where it is not in camera view. But, somehow, that is the only way to make it visible to the camera. Also, when looking around, if model gets a bit closer to the camera during animation, camera does not render the weapon and only the hands can be seen. Placing the hand model further makes the arm end points (empty shoulders) visible so it is not an option.

Also, when I scale down the GO holding the model, the box around the model is not scaled down enough (or model is scaled down more than it needs to) so I end up with a box too large for the model..

For those who worked on 3D, am I doing something wrong?

Any tips on 3D with Defold is appreciated :slight_smile:

1 Like

Focusing on camera makes you show the whole FOV, so if you have - by default 1000 Far Z, then the far plane is 1000 units away from camera, which is pretty big (relatively). Built-in cube or quad (or capsule) are having 1 unit dimensions, because you don’t really need much more - those are very simple meshes, so really small compared to 1000. On the other hand the more complex model have actually much more polygons, with dimensions between them usually also around 1 unit, so the whole mesh is much larger. So the scales of models will vary a lot.
Try the 1.11.2 beta - it has few great improvements for camera - especially the “camera” component preview being in screen space, not world.

Btw, I made a material for textures, that is “tiling” the textures with a given zoom, so that if you scale the model, you can adjust the texture size too: it’s pretty basic, here’s the diff for .vp between this material and built-in model_instanced.vp (or check out the commit):

Are you sure you are not changing positions or so in the code at init?

Can you show the recording too? Seems strange.

Imho this does not feels right too. Could you please create an issue for this on github?

1 Like

Just a quick note about free models… When I was prototyping this: https://x.com/selimanac/status/1886859611938213941, I was searching for a free hand and gun model with animations (like the ones you’re using). I spent days trying everything I could find (faps, itch, sketchfab etc like a maniac :sweat_smile:), but almost all of them caused problems with scaling(mostly because of the bones), positioning, or animating. Most of these issues seem to come from converting FBX to GLB, so I’m pretty sure that’s the root cause.

I was also rendering the gun to a separate render target to prevent multiple issues.

Unfortunately, I wasn’t able to complete this example project due to freelance stuff, but I hope to get it working this winter.

1 Like

The model I am using did also have problems with animations but after deleting some bones and making armature the top node? at the Blender, animations were working properly

1 Like

Yeah, same in my case. it’s almost impossible to resize, convert, and export them as glb from Blender properly. At least I couldn’t manage it. It’s almost always better to create this kind of stuff from the ground up in Blender rather than using someone else’s messy model and bone structure. Hope you can get it working! :slight_smile:

P.S. – this is why I ended up with just a single gun :slight_smile:

2 Likes