I thought it was. Basically i’m trying to project an object to another position, without actually having it there.
I have the projected center point and i thought i could do
Center + mesh. vertex to get the projected vertex point. But it seems to be way off.
I know the center is correct because i did a debug ray and i can see the center is in the center of the object. (in that case i’m projecting it to where it is because its not changing position so its being projected to zero change)
but it seems a debug ray for each vertex which should be at each actual vertex point is off. Just seeing if someone knows if that assumption is wrong before i go into more detail with my problem
I actually can’t believe that no one posted the function he needs
Like Jessy said the vertex positions are in local space. But it seems some forget what a “coordinate space” is. It has it’s own origin, rotation and scale. Juest adding the position will work when the model’s transform isn’t rotated and has a scale of 1,1,1.
If you just take a look at the Transform documentation You should have found TransformPoint or localToWorldMatrix.
The pivot point of a mesh might be in its center, or it might not. It depends on how you modeled the mesh. Transform.position is the pivot, in world space; it’s Vector3.zero in local space. Mesh.vertices are in local space.
mesh are normally centered around zero vertices and go into + and minus fields and so do their bounds if you print them the bounds encapusalte the triangles, and nrom ally go in neg space,
This took me ages to figure out… to get a mesh perfectly into positive space, and bounds too, you have to do:
msize = size multiplier i.e. 1.0;
transform.localScale = Vector3.onemsize;
transform.position = -bounds.minmsize;