Help with building system

I have built a basic building system using basic raycasting on the client side.
I have a gif below:

https://gyazo.com/a1d4d2b1f31ec31294f231cc201c9bf7

As you can see, when placing floors, half of the floor intersects with the other half of another floor.
My question is, how can I offset the floor in such a way that it will not be intersecting with other floors?

1 Like

Do you mean like a snap to grid or a collisions system? Snapping to grid would be limiting the vector3 according to a certain stud difference or only even numbers for example.

To offset the position so the floors have “collision” when placing and not intersect you must take the current position and size of the hit object and add it onto the respective axis.

I don’t want to give you a wrong calculation here so I wont post one but that is the idea of things. Hopefully someone who is math wizard can provide a working example.

2 Likes

This simple step did the trick. Thanks : )

2 Likes