Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a placement system that knows to place items on the correct face of an object?

Asked by 5 years ago

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.

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

Answer this question