0 votes

I am using a tilemap to generate a map in my project. I want to give some tiles some properties, but I don't know how. For example, when I walk on a door tile, I want the scene to change. How do I connect the tile area or the tile itself to a script file?
Sorry to bother, thanks for help!

Godot version v3.2.3.
in Engine by (12 points)

1 Answer

0 votes

You can't connect the individual tile or tile area to a script file since the tile data is stored in a tileset and the tile collision is combined into one big collision shape. You will need to use TileMap functions like world_to_map() in order to convert the coordinates of the area to the coordinates of the tile and then get the ID of the tile at those coordinates.

by (7,336 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.