So, imagine a cube. This is the larger parent. This cube is made up of a bunch of smaller cubes in a 3x3x3 formation. Each of these smaller cubes is a smaller parent made up of six faces. Large Cube > smaller cubes > faces.
I need the positions of the faces. transform.position gives me their world position, transform.localPosition gives me their position local to the smaller cubes. I want to get their local position in terms of the larger cube space.
If I have to I can take the local positions of the faces in terms of the smaller cubes and convert them with some math, but is there a simpler way?
Thanks!
Thank You So Much This Fixed Everything! I have honestly been trying to figure out the answer to this for 2 weeks! @Genei_180
If you need to transform a lot points from one space to another you can simply create a conversion matrix by combining the right worldToLocal and localToWorld matrices.
Keep in mind that matrix multiplications work in reverse order. So if you have a source space and a destination space you would do:
Matrix4x4 m = dest.worldToLocal * source.localToWorld;
Now you just have to multiply each point with that matrix:
Thank You So Much This Fixed Everything! I have honestly been trying to figure out the answer to this for 2 weeks! @Genei_180
– LittleBitStudios