How can I get the world position of a vertex on a mesh? transform.TransformPoint() is not working for me

Hello, I need to return a single vertex on a mesh in world coordinates “Vector3.Position()” I have tried using:

  Vector3[] meshVerts = someRandomGameobject.GetComponent().mesh.vertices;
  Vector3 vertPos = transform.TransformDirection(meshVerts[0]);

and

  Vector3[] meshVerts = someRandomGameobject.GetComponent().mesh.vertices;
  Vector3 vertPos = transform.TransformPoint(meshVerts[0]);

I am unable to return a vector3 in world coordinates with transform.TransformDirection() or transform.TransformPoint() Is this a bug for vertices or am I doing something wrong?

I am able to get the actual point in space by:

 Vector3 vertPos = gamobj.transfomr.position + transform.TransformPoint(meshVerts[0]);

But this will not return the rotation, any help would be greatly appreciated! Thanks!

Here is the full code if you want to check it out:

public GameObject  someRandomGameobject;
public void Start()
 {
      Vector3[] meshVerts = someRandomGameobject.GetComponent().mesh.vertices;
      Vector3 vertPos = gameobj.transform.position + transform.TransfomrPoint(meshVerts[0]);
      Debug.Log(vertPos);
  }

Thanks!

I’m pretty certain Transform.Position is always in world coords so doesn’t need to be converted.

Edit. After posting was this, just realised, I don’t recall of hand if vertex positions also are since they are not transforms

Im converting this to an answer despite the question being closed, because the more I think about it the less the accepted answer appears to address the issue.

The thing is, what exactly do you mean by “the rotation of a vertex”?

In a mesh, a vertex does not need to have a rotation. It only has position. That’s why it’s a Vector, and that’s why you shouldn’t expect to be provided with a method to somehow get a Transform from a vertex.

In many meshes, there will be normals associated with the vertices. This is the only sense I can think of in which a mesh vertex can be said to have a rotation/direction. You can get the normals from the mesh using Mesh.normals and, should you choose to, construct a Transform from a vertex’s position and normal.