I am making a game where you can build. Now one problem.
I want to make a grid thingy where the part snaps to a grid. I tried using
CFrame.new(position.X - position.X%3, position.Y - position.Y%3, position.Z - position.Z%3).Position
I also tried math.floor(X / 3) * 3 but it gives the same result
If i want to build up, then place a part on the left side or right side then only one side works, if i try placing the block it goes inside of the block, but not on the other side.
Is there any other method? How do i fix this?
some other info:
The part is a 3x3x3 and the snap value is 3, so it will snap every 3 studs
The baseplate is one single block, there’s no multiple blocks simulating a grid.
I want a snapping similar to Build A Hideout And Sword Fight’s
please help; if you need more information please tell me
The math.floor() way should have worked. Can you show the exact code you used? Also try using math.round instead of floor, it should feel more natural.
You seem to have two different positions going into Snap, “position” and the raycast result’s Position (ins.Position), did you mean to use ins.Position?