Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I get the position where two bricks touch?

Touched only returns the brick that's being touched. Is there an event or function that returns the point two bricks are touching at?

7 comments

0

I don't think so.

1
0

I heard Raycasting is an expensive operation so I'm wary of using it, but if it's the only option I suppose there's no choice.

0

Nothing is "expensive" unless you do it very rapidly.

2

EgoMoose has a more in-depth article explaining how to do exactly this (and more!) here: http://wiki.roblox.com/index.php?title=User:EgoMoose/Articles/Rotated_region3

0

You could use the size ratio of the parts and then take the position of each part and move between the parts according to the size ratio to get the approximate collision spot. Just an alternative to Raycasting.

0

@adark you should rewrite your post as the answer. With a little tweaking it would work perfectly.

1 answer

If you want to you can do some math that will calculate the distance from the center of one of the parts to the edge of the side that was touched but that would be even more scripting then raycasting

This discussion is preserved as it was. New answers, comments, and votes are closed.