+1 vote

Hi

I have my player as a child of a tilemap and I use vsort so he can walk behind rock, etc.

Can I use 2 tilemaps in which a player Y sort through both.

The scenarios in which I want to use this for:
- I have 64 tiles but also want to use 32 tiles for smaller objects
- I want to layer a tile over another for small variances (e.g. fence and a bird on the fence, etc).

I can overcome these issues by setting up all tiles for all scenarios but it's time consuming.

Is this possible?

in Engine by (13 points)
retagged by

1 Answer

+1 vote

As far as I know you can't. YSort works only with its immediate children nodes, so having two TileMaps with YSort (or using a YSort node with the 2 TileMaps) won't be a solution. For small objects you could use StaticObjects. This way you still can use the YSort functionallity. To make it easier, you should try the Asset Dropper plugin. This plugins allows you to easily add and move you objects to the scene.

The good thing of using the small objects as static objects is that if your player need to interact with them, you can do that. If those objects were tiles it would be rather impossible.

by (689 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.