Can I duplicate a tileset texture while keeping the bitmask and collision?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By godotter027

I am an amateur godotter and I am making a Celeste style game and I want to duplicate a tileset texture and change the file but keep the (really time-consuming) bitmask and collison intact. Is there a way I can do this or will I have to do it manually again?

:bust_in_silhouette: Reply From: Kyle Szklenski

The easiest way is this:

  1. Save out your base tileset as a text resource file (save it as a .tres)
  2. Duplicate the file on your hard-drive; you can do this with Godot’s built-in Duplicate function in the FileSystem (right-click the file) and it’ll give you the option to rename the file, which I think is nice, or you can just do it in Explorer or whatever OS you’re using’s file explorer is.
  3. Open the .tres file for the duplicated file in VSCode or some text editor
  4. Near the top, you should see the texture which is defined for the previous tileset - replace the path for that with the path to the new texture you want to set
  5. Save the file and go back into Godot

This should give you a second tileset .tres file which now has the new texture with the same collision, navigation, occlusion, bitmask, priorities, icon, region, and z-index as the previous one.

Thanks, I figured this out about a week after asking the question

godotter027 | 2020-12-20 15:44