# Can you explain this little code for me

**URL:** <https://forums.unrealengine.com/t/can-you-explain-this-little-code-for-me/44023>\
**Category:** Off-Topic\
**Tags:** unreal-engine\
**Created:** [October 7, 2015, 4:55pm UTC](https://forums.unrealengine.com/t/can-you-explain-this-little-code-for-me/44023 "2015-10-07T16:55:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nbtthief](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nbtthief](https://forums.unrealengine.com/u/nbtthief)\
**Post date:** [October 7, 2015, 4:55pm UTC](https://forums.unrealengine.com/t/can-you-explain-this-little-code-for-me/44023/1 "2015-10-07T16:55:51Z")

</div>

In this tutorial video: 10 - Using Loops : Procedural Level Design

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

At the beginning, the instructor let var EndPoint multiply with vec (1.,1.,0.) =\> what is this code for? i try to understand it but i still cannot see any link between this code with Not Equal comparation

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Nawrot](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nawrot/32/618260_2.png) [@Nawrot](https://forums.unrealengine.com/u/Nawrot)\
**Post date:** [October 9, 2015, 12:32pm UTC](https://forums.unrealengine.com/t/can-you-explain-this-little-code-for-me/44023/2 "2015-10-09T12:32:02Z")

</div>

I assume you are wondering why he is multiplying by 1,1,0 vector.

vector1 \* vector2 works like this: x1_x2, y1_y2, z1\*z2

so when he multiplies any vector by 1,1,0  
it will nullify Z value (ie snap to ground plane)

This trick is also great for making square grid of meshes:  
get integers out of forloop indexes: “nth loop on X” and “nth loop on Y”. Make those 2 into vector, lets call it “index\_Vector”  
Make vector with sizes on x, y, y for mesh (or spaces in square grid you are making) call it “spacing\_Vector”

then:  
“index\_vector” \* “spacing vector” will give you nice grid locations.

much less connections than calculating all values separately.
