I have 4 objects in array, objects vectors:
1, 1, 1,
1, 2, 1,
1, 3, 1,
2, 4, 1,
How can I retrieve 1.25, 2,50, 1? all vectors from the arrays objects and use that to get a new vector3?
I have 4 objects in array, objects vectors:
1, 1, 1,
1, 2, 1,
1, 3, 1,
2, 4, 1,
How can I retrieve 1.25, 2,50, 1? all vectors from the arrays objects and use that to get a new vector3?
Access all x values, add them and take average, repeat this for all y and z.
logic c#:
Go through this link for logic of multidimensional array
[1]: Multidimensional Arrays - C# Programming Guide | Microsoft Learn
So you get 1.25,2.50 and 1.
now make a new vector3 as Vector3 v3=new Vector3(1.25,2.50,1);
And if you want magnitude as one , just normalize it.
v3.normalize();