Mesh not where it should be

I’ve got a script that generates a mesh. After the mesh is generated and I move the object I have an odd issue where it’s not actually where it says it is. When I move the transform the object does follow but its offset, closer to the position I generated the mesh at. If I regenerate the mesh then it pops to the correct location. Any ideas on why this might be?

figured it out, for anyone that has a similar issue: When I create the mesh I first have to move the gameObject back to Vector3.zero, create it, then move it back to its original position. Something about being created off in space messes up the Transform.

Please remember,

If dragging from the project inspector, it will use screen to world coordinates to drop it in the scene.

If you have a prefab that you created, it would be wise to set the most parent/root object of the prefab to origin(0, 0, 0), of course this only applies if it meets your needs. Where the prefab is created first is by default it’s location when instantiated.