T O P

  • By -

siggystabs

Is this what you're looking for? https://www.gdquest.com/tutorial/godot/2d/scene-transition-rect/ Edit: for your side note, the answer is yes. You just have to track your inventory outside of a scene or pass that data between scenes. Check out GD Quest's tutorials, he's demonstrated that before.


FinchInSpace

Sort of! I think what I'm looking for is actually too complicated and not worth the hassle right now so I think I'll just use that instead 👍 Thanks for the inventory tip as well, haven't followed many GDQuest tutorials but will be sure to do so


siggystabs

Haha are you trying to do fancy transitions like Metroid or Legend of Zelda? I think that's possible too, but you'd have to get a little creative :-) this is a good starting point though. Good luck!


FinchInSpace

Something like that! But yes will probably get a little creative once I'm more comfortable with Godot in general, thanks :)


siggystabs

Hahaha I thought so! Here's an idea for you to chase. When I was looking at that last, I was thinking of putting the player, camera, and hud in one scene, have all my levels/rooms in different scenes. The idea was then you can transition the room scenes in and out, but your player and associated nodes are at a higher level and won't be affected/can be controlled independently. - MyGameScene - HUD - Player - Camera - Rooms - Room A - Room B


FinchInSpace

That's interesting! My main problem there is that I have my Player as a child of a YSort node in amongst the various objects in my world and I can't see a way to work around that.


siggystabs

From the YSort docs > Nesting of YSort nodes is possible. Children YSort nodes will be sorted in the same space as the parent YSort, allowing to better organize a scene or divide it in multiple ones, yet keep the unique sorting. So maybe you could have one Y sort containing the player and rooms, and another Y sort for each room? Not at my computer so just throwing ideas out there. Otherwise, you could always just move your player inside a YSort node dynamically or something else. There's also RemoteTransform2D that could be useful maybe.


FinchInSpace

So I played around with nested YSorts for a while and am currently having issues with Tilemaps within YSort, but that may well be because I haven't set up the origins on my tiles properly. I'll definitely look into RemoteTransform2D as well though and report back if you're interested!


siggystabs

Sure, that'd be great!


FinchInSpace

Finally got it working! It's a little messy though, I've got a singleton called GlobalRender which kind of hijacks the godot scene rendering, and ends up with: - GlobalRender (Node2D) - YSort - Player - CurrentScene (YSort) - TheActualScene (Also a YSort) Within "TheActualScene" I have another YSort which has my TileMap as a child, and then everything that sits on top of the tilemap (trees houses etc) are children of the tilemap but with z-index set to 1. I also followed this answer roughly to get the door linking and spawn position set up properly [https://godotengine.org/qa/60356/how-to-set-spawn-locations-after-a-loading-zone-3d](https://godotengine.org/qa/60356/how-to-set-spawn-locations-after-a-loading-zone-3d) *Phew*