
0
Under review
Find the world position for a room left corner
I am working on a code that will spawn in designed rooms to fill the empty rooms. Is there a way to figure out how to calculate the world position of the room cell

0
Under review
Daedalus 10 років тому
You can have a look here for a list of all of the exposed methods; in your specific case, you could use GetObjectsOfType(SelectionObjectType type)

0
John Leutz II 10 років тому
Ok I understand how to use the GetObjectsType....My prefab is a whole room in itself, I can capture the rooms cell so I know the cell location the room is generated. I am just trying to figure out how to translate that (i believe it is the left corner of the room) to a world postion.

0
Daedalus 10 років тому
Well, as of now, that's the best you can get with GetObjectsOfType, but given that your prefab is a whole room, you could just put an empty GO or something like that in the left corner of the room; how does that sound?

0
John Leutz II 10 років тому
Nods...Question...does your cells function in a grid base, and the size of a tile...If that is true then I could multiply the cell location by the tile size to get the corner I am looking for?

0
Daedalus 10 років тому
Yes, of course it's grid-based, so if you're using modular stuff it should be easy to do what you say.

0
John Leutz II 10 років тому
Thank you for the information.

0
Daedalus 10 років тому
You're welcome! Let us know if you need to know something else.
Служба підтримки клієнтів працює на UserEcho