So I am trying to make a placement system for one of my games, and am able to track the mouse, create an object, weld objects together, and any other tool functions, but I can't figure out how to make an object place itself on the correct face of an object. For example, if I were to point my mouse at a brick, the object I'm trying to place would put itself halfway inside of the brick. I've tried things like extruding the part towards the player by half of the size of the brick I am placing, but I would have be on the opposite side of where I want to place the brick, and I couldn't get it to work anyways. I tried looking at the old stamper tools and such, but those are 3000+ lines long and I am making a very basic placement system. Any help would be appreciated, and let me know if you need anything from me. I am using mouse.Hit.p and setting my block to that position if that's of any help.
COMMUNITY QUESTION
How do I make a placement system that knows to place items on the correct face of an object?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
When u set the parts position don’t just make it the mouse pos u have to find one of the corners or sides
My bad, but u can try raycasting from the mouse position to the size
Egomoose made a tutorial a while back about surface normals which covers exactly this, if I find it i will provide the link.