#Why im not seeing my 3d card in my camera 3d in my 2d game?

1 messages · Page 1 of 1 (latest)

crimson mist
#

these are the editor images of what i did in it.

crimson mist
#

where?

crimson mist
#

you mean another of these that i already did?

fervent remnant
crimson mist
#

it still doesn't appear in the editor or the camera view

fervent remnant
#

also srry if my answer was stupid earlier im half asleep xD

crimson mist
#

no

#

i mean, it still doesn't appear

rapid seal
#

is backface culling disabled on the card?

#

also, what is that (1 change) in the Carta3D's transform? (first picture)

crimson mist
#

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

rapid seal
#

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

crimson mist
#

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

crimson mist
#

any other hint to know what could happening to me?

fervent thorn
#

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.

rapid seal
crimson mist
#

i cant even see the card in the editor

feral bear
#

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

crimson mist
#

it also doens't appear in the editor.

feral bear
#

You know, something looks off about your grid. Are you super zoomed in on 0,0,0?

crimson mist
#

this is my zoom

feral bear
#

Yeah, zoom much further out, you are zoomed as closed as possible so the editor might be inside the meshes and not showing them

crimson mist
#

it still the things doesn't appear

feral bear
#

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

crimson mist
#

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?

feral bear
#

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

crimson mist
#

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.

feral bear
#

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.

crimson mist
#

canvaslayer is aside of the subviewportcontainer and its childs

crimson mist
#

i delet the canvaslayer, any other info of how to make this 3d card visible in my 2d game?

rapid seal
crimson mist
#

most of the tutorial are old and doesn't work for this actual version of godot

#

i gonna take look of it

crimson mist
#

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?

crimson mist
#

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.

rapid seal
#

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?

rapid seal
crimson mist
#

didnt know of that is ixist

#

thanks

rapid seal
#

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.

crimson mist
#

it talk about viewport and subviewport are different

#

that is an old tutorial

rapid seal
#

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

crimson mist
#

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.

rapid seal
#

using SubViewport is correct

#

but you don't need the SubViewportContainer since you're using a Sprite2D with ViewportTexture

crimson mist
#

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

rapid seal
#

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.