Hello.
V in untiy allows vertex snapping, snapping objects to the vertex positions of other objects.
I want to make a planetary city builder game where buildings can be placed on the vertexes of a textured sphere. With the V key, I can do so in the normal editor, but I don’t know how that would work at runtime.
How can I do this kind of snapping functional in game / at runtime?
You can get a list of vertices through mesh.vertices. You’ll probably need to transform them into world space.
Thank you for the idea! So, how would I write it that my objects align to the position of the list of the world space mesh.Vertices?
You can read the mesh.normals to get their “directionality”, if that’s what you mean.