What I want is make a map with different “types” of GameObjects: house, road, park… I have real data and I want to use that to build the scene through a little script, and I was wondering what way would be the best to differenciate each one. For example if it’s water, I want a trigger to make the player swim, not when the player touches a building.
What I thought is to create empty prefabs, instantiate the type of prefab I want and then modify the instantiated object.
Is that a good way? Or what should I do?
You’ll need your map loader to have a way to associate your real data with specific prefabs that you spawn in the scene. I don’t know what your data looks like, but it shouldn’t be too hard to figure out. As for the logic of your water, or other “tiles”, have them self-contained in specific scripts. A Water script that triggers swimming, a House script that triggers… whatever.