Now I have script that creates mesh from the vertices I created. Than in this script I instatiate prefab with MeshRenderer and MeshFilter components on it and assign created mesh to this instatiated object.
These intatiated-gameobjects should been teleports for player and when I enter into one gameobject it should teleport me to another.
When I create instatiate-object I set it position to Vector3.zero for the correct location of mesh between created dots just like this
But the problem is that position of all created gameobjects with meshes is (0,0,0) in global coordinations and when I try to teleport it always moves me to (0,0,0) position. I realize that reason of that is maybe in setting gameobject position to Vector3.zero but when I try to set position to another (such as first vertice or player transform) it moves Mesh far away from the desired position.
So my question is: how I can correctly locate instatiated gameobject so that it have global world coordinates?
P.S Dot in red circle is one of the created vertices of which mesh is made. It position is (32, -19, -104), but position of instatiated object is (0,0,0)
Also You should not being using the meshes coordinate space to determine its local or world position. You should probably try to draw the mesh centred around the origin or at the very least around its point of rotation (I would argue that thats also a bad practice as you can emulate this with nested transforms anyway) then position the game object that the mesh is on instead.
If you are doing this procedurally adjusting your code would be necessary if you are using a 3D modelling suite then there is probably a feature that lets you do this built in. e.g.
I found a solution to the problem.
The thing is, the every mesh was created at Vector3.zero point and its looks like at the same time each mesh was in its own coordinate system with center in mesh position. When I tried to teleport to any mesh object it was moved my player to (0,0,0) global coordinates, not to particular mesh position that I needed. Solution was very simple: despite that every mesh has (0,0,0) coordinates (regardless of real global position of object) player object can teleport to mesh using it Collider position