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

How would I attach one Part to the face of the other Part?

Asked by 5 years ago

Hey, title is self-explanatory. I'm trying to make a placement system with a ghost that follows the mouse, however that ghost moves closer to the camera the longer I hold the mouse at the same spot, so I figured that I have to attach the part to the face of the other - Correct me if I'm mistaken. Thank you in advance.

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

however that ghost moves closer to the camera the longer I hold the mouse at the same spot You need to filter the part, not attach the part to something. The problem is that your script detects your ghost in the new position, then finds the edge of the ghost the next frame and thinks the user is aiming even closer to the camera than before.

To fix this: presumably you have a script that uses either Mouse.Hit or one of the workspace's FindPartOnRay___ functions. In the former case, see if using Mouse.FilterTarget helps - if not, or if you're using the workspace's functions, use something like workspace.FindPartOnRayWithIgnoreList. Add the ghost to the "ignore list" and the mouse mouse will no longer collide with the ghost (causing the ghost to get closer to the camera over time).

To actually attach parts together, look into using a WeldConstraint - put the parts how you want them in the world and connect a WeldConstraint to them and Roblox handles the rest.

0
Thank you for your help! KhanPython 7 — 5y
Ad

Answer this question