Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hello, Seanba!

I'm experimenting with the prefab replacement feature. I'd like to be able to replace an object with my prefab but retain the collision geometry as it is. ST2U creates a BoxCollider2D, PolygonCollider2D, or EdgeCollider2D based on the geometry but this collider is lost when the object is replaced with my prefab.

I don't think there's a natural way to merge the colliders into a prefab that would work for everyone, so what I'm hoping is for a way to hook a script to the TMX import. There I could transfer the collider geometry into my prefab. Does such a hook exist already?

Thanks for the excellent tool!

(+1)

Hi there, Armakuni. This is exactly the kind of thing you would use a Custom Importer for. It's a script you can attach to the importer process to do extra work on your TMX prefab just before the import completes.

This repository here uses one such custom importer and it should serve a decent starting point for you: https://github.com/Seanba/SuperMovingPlatform