I have been searching through answers of this same question and I haven’t been too successful in trying to make it happen. So what I am trying to do is create an in game building system in which you build buildings. I am able to get certain parts and move them around with my mouse. However, whenever I try to place a part (for example a wall on a foundation) it doesn’t snap in like they do in Rust, or other survival games. I have seen people talking about nodes and how two nodes can come together and snap objects in place but I am an amateur programmer, and I have no idea how to create a node. So does anyone have any idea on how to create the foundation for this or simply know a tutorial. Thank you in advance.
Assuming all of your pieces will be prefabs, you could just create empty GameObjects where you want the pieces to snap together inside of your building piece prefabs. Then call each GameObject something that’s numbered sequentially (or keep them in an array) and then when snapping pieces together just go through each and every one of them and make the snap positions of the piece you’re adding match up with the snap positions of what you’re adding it to.