[ad_1]
Godot 4.2
Background:
In my recreation prototype, I’ve a following participant entity:
Paperdoll2D has a script that dynamically provides the weapon/armor/and so on Sprite2D nodes to the primary sprite to “dress-up” the character in-game, much like this:
The sport is 3D with flat textures used to characterize ingame objects (thinks authentic Doom, Daggerfall and so on).
Drawback assertion:
I would love the Player3D to have such a texture (for cutscenes, third individual and so on). Already, Paperdoll2D node mainly composes a whole 2D texture with geared up gear and whatnot, so it is smart to make use of it to supply a Sprite3D texture.
Suppose the inexperienced define on the picture above is the “Screenshot space”. That space (and solely that space of the 2D display) is rendered to a texture and utilized as a texture to the Sprite3D (non-realtime, solely on demand).
Viewports can be nice for this as a result of they’ll “screenshot” the paperdoll and supply a ViewportTexture to be used in Sprite3D.
Drawback is, to me Viewports have been at all times non-intuitive. Each tutorial on YT and the official Documentation on Viewports lists the next technique to have Viewport really show one thing:
It really works, however all of the “energetic” nodes (sprites, participant,and so on) should be “inside” the viewport. Additionally it is very unwieldy – any youngsters of the viewport can’t be moved,scaled, rotated, nothing.Furthermore it unnecessarily complicates the tree construction making irritating to work with.
How do I implement this with out having to have the viewport contained in the Player3D node or having to .reparent the Paperdoll2D to the viewport exterior?
[ad_2]