I need help with the location of instatiated objects on the scene and correct interaction with this
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
GameObject mesh = Instantiate(Mesh, Vector3.zero, Quaternion.identity);
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)
Your answer
Follow this Question
Related Questions
How to properly make an object follow the edge of another object? 0 Answers
Trying to Generate Different Random Values for Position of Game Object Instances [C#] 1 Answer
How do I specify the origin and end points of the arc1 instantiated line? 0 Answers
Need help with multiple updating transform positions 2 Answers