0 votes

How does one place tiles that are invisible or run-time? I plan to have it visible whilst editing the project, but upon running, it becomes invisible, but its collision still works. It works somehow like the barrier block in Minecraft. Its the closest example I can think of.
enter image description here
The tile I'm planning to make invisible is the red void tile highlighted. Its there on the 2nd floor to prevent manually controlled entities from walking of the edge of the raised platform.

asked Aug 9 in Projects by rabbitslime (25 points)

1 Answer

0 votes

You can add a script to the tilemap:

func _ready():
  tile_set.tile_set_region(invisible_tile_id, a_transparent_region)

Should be possible with modulate too but looks like is not exposed to gdscript, not on 3.0 at least but may be accesible via set.

answered Aug 10 by eons (6,498 points)

I made it a different way, I separated the void tiles into a different tilemap, had them hidden and their collisions still appear. I usually end up solving majority of my own problems with hints from others or similar instances I find online.

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.