More Unity research this week, no introduction needed.
Used in programming to repeat a specific block until an end condition is met.
So, the beginning of a sequence in is executed only once. Then the decision is evaluated. If the decision is false, the for loop is terminated. But if the test expression is true, code inside the body of the for loop is executed and the update expression is repeated.
For Each Loops:
These are a control flow statement for traversing items in a collection.
A For Loop can be a variable which is created used as an index to an array. If the loop is only making modifications to each item in the index then this method a clumsy way of expressing a programmers intentions. The For Each loop simplifies this by exposing each item without needing to know it’s position in the list.
Maths: Dot Product
There’s no way my anti-maths brain could write this out in a coherent way that would make any kind of sense, so here’s a screen grab that does the job. I know its technically cheating but I’d literally have no idea what I’m talking about and I’d probably end up messing it right up.
I get that its showing you how to do it but its how you do it that I just can’t understand. Maths whizz and programmer I ain’t.