Seems im doing something wrong.
void Start () {
PaintableObjects = GameObject.FindGameObjectsWithTag("paintable");
Matrix4x4 localToWorld = transform.localToWorldMatrix;
foreach(GameObject go in PaintableObjects) {
Mesh mesh = go.GetComponent<MeshFilter>().sharedMesh;
testing = new Vector3[mesh.vertices.Length];
for (int test = 0; test < mesh.vertices.Length; test++) {
testing[test] = localToWorld.MultiplyPoint3x4(mesh.vertices[test]);
Debug.Log(testing[test] + " " + mesh.vertices[test]);
}
}
}
i have also tried transfrom.TransformPoint();
but i keep getting 0.5,-0.5,0.5 on both sides but that shouldn’t happen the objects arent placed at 0.0.0 but at different locations.
im using cubes to test so local world should be 0.5,-0.5,0.5 and with the x 2 the world space should be 2.5,-0.5,0.5 but instead im getting the normal value i get.
not sure what im doing wrong