#Why im not seeing my 3d card in my camera 3d in my 2d game?
1 messages · Page 1 of 1 (latest)
where?
you mean another of these that i already did?
remove it from the container and see if it fixes the issue
it still doesn't appear in the editor or the camera view
have you tried playing the scene
also srry if my answer was stupid earlier im half asleep xD
is backface culling disabled on the card?
also, what is that (1 change) in the Carta3D's transform? (first picture)
im not finding that "culling" setting in the meshinstance3d back of the card, and the 1 change of the card is just a positions that i was testings
it's in the material under transparency->cull mode
since you're using two meshes, one for the front and one for the back, you should probably rotate the backside 180 degrees around y, instead of disabling backface culling, even if that fixes the issue
otherwise you might get z-fighting
yes i rotate the back of my texture 180 grades and it doesn't have z index, but it doesnt even appear in the editor, it just appear in its own escene.
i also was testing moving it in the z axis
any other hint to know what could happening to me?
This might sound silly, but have you saved the card scene? I had a similar issue and it was because I kept trying to add my scene to another scene without saving it first.
What do you mean by "it doesn't have z index"? If you rotate the camera in the editor in the card's own scene, is the backside visible?
i cant even see the card in the editor
Add a MeshInstance3D with a basic PrismMesh as the mesh next to the Carta3D object to see if that appears?
that will narrow it down to whether problem is with your Carta3D node or something else
it also doens't appear in the editor.
You know, something looks off about your grid. Are you super zoomed in on 0,0,0?
this is my zoom
Yeah, zoom much further out, you are zoomed as closed as possible so the editor might be inside the meshes and not showing them
it still the things doesn't appear
Well now you're zoomed too far out. Try a zoom of about 6m. If that doesn't work then something is weird. Create a new scene (node3D) and add the meshinstance3d prism there just to make sure the editor is working
i put everyting out of the ssubviewportcontainter and subviewport, then it showed up in the edito. So what is the correct way to show a 3dcard in a 2d game?
Subviewport containers are the way to achieve 3D "windows" in 2D. Can you show me your subviewport settings?
Maybe you have turned on "Own World 3D". In that case, the subviewport should be a child of the subviewportcontainer and will only be visible in the 2D view
yes it was that setting "own world 3d" that hidden my 3d card of the game screen or the screen editor, thanks you.
but it still doesnt appear in the game, It apprear in the editor but not in the game.
When you're running your game, there are two tabs above the node tree "remote | local" -- normally in the editor we are seeing the local node tree but when running you can access the debug node tree (the remote tree). You can click on a node and check its attributes such as position / size / visible... In this case I would run the game and check the remote node "CanvasLayer" to see what it is doing. It might be size (0,0) or off screen or invisible.
canvaslayer is aside of the subviewportcontainer and its childs
i delet the canvaslayer, any other info of how to make this 3d card visible in my 2d game?
There's a demo project for that. Have you had a look at that? https://docs.godotengine.org/en/stable/tutorials/2d/introduction_to_2d.html#d-in-2d
Godot's 2D game development tools include a dedicated 2D rendering engine, physics system, and features tailored specifically for creating 2D experiences. You can efficiently design levels with the...
most of the tutorial are old and doesn't work for this actual version of godot
i gonna take look of it
when they star to explain the 3d in 2d, they only give a example proyect so is kinda difficul to know what exactly they did to do that.
Any other good information about this pls?
i think i replicate the example proyect nodes way to do it, but i still can't see my 3dcard in my 2d game, maybe i have to explore more the proyect extample.
So you have a Sprite2D that has a a ViewportTexture that has its ViewportPath set to the SubViewport that your card scene is parented to?
Inside that card scene there is the card and a camera that is facing the card? You may also need a light, and/or a WorldEnvironment inside that scene.
The SubViewport needs to have the size you want the sprite to be and you will likely want to enable transparent bg on it.
What do you use the SubViewportContainer for?
Replicating the scene tree layout is not enough. Have you read the readme in the demo project directory?
The demo projects are a valuable source of information. I'd strongly recommend going through them, i.e. clone the repo and open them in the editor and have a look how things can be done.
doing what the demo does works fine even in 4.4.1, you're on 4.2.2, so that shouldn't be an issue
i remember saw a tutorial using viewport and i tryed to emulato with subviewport and didn't work, i think i going to try to replicate it again maybe.
using SubViewport is correct
but you don't need the SubViewportContainer since you're using a Sprite2D with ViewportTexture
i did it like a tutorial say, and the error was that i was creating all in an different scene than i instance it but then i directly create the viewportcontainter->subviewport->3d texture (meshinstance3d) in the main scene and it show up in the game. Thanks for all the help to everyone
Using SubViewportContainer instead of Sprite2D for game objects (as opposed to UI) does not seem like a good choice. Instancing a scene instead of putting all nodes into one scene is also not the reason it didn't work.