here's my implementation of that:
- create a new viewport node and name it "minimap". set its size to the desired size of your minimap.
- add a
Camera2Dnode as a child of the minimap node. - add a sprite node as a child of the minimap node.
- in the
_ready()function of your player script, get the minimap viewport and set its render target to a new image texture. - update the sprite's texture in the
_process()function to the image texture of the minimap viewport.
node tree might look like this:
- spatial (root)
- player
- camera
- script (player.gd)
- minimap (viewport)
- camera2d
- sprite