You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I am trying to snap the item to other parts. Like the placement system in “Build A Boat For Treasure”, where it can rotate and still work.
- What is the issue? Include screenshots / videos if possible!
It kind of works but it doesn’t really work that well. (I don’t know how to add videos or screenshots)
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
This is the original code (Did not work with rotations but worked the best):
--originalVector3 is the mouse position vector3new = originalVector3 + (Vector3.FromNormalId(normal) * (blockSize / 2))
*If anyone knows how to make this work with rotations, that will work!
This is the best try I have, but it did not work out well:
local worldCF = target.CFrame:ToWorldSpace(CFrame.new(Vector3.FromNormalId(normal))) local offset = wCF.Position - target.Position vector3value = originalVector3 + (offset * (blockSize / 2)) --I tried to find out what is the "normal" compared to the target, and then I tried to find out how was compared to the part in WorldSpace
Thank you for any help!
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.