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

How can I get the position where two bricks touch?

Asked by
Zerio920 285 Moderation Voter
7 years ago

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

0
I don't think so. OldPalHappy 1477 — 7y
1
Raycasting is your best bet here. http://wiki.roblox.com/index.php?title=Raycasting_Basics ausmel105 140 — 7y
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. Zerio920 285 — 7y
0
Nothing is "expensive" unless you do it very rapidly. cabbler 1942 — 7y
View all comments (3 more)
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 adark 5487 — 7y
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. magiccube3 115 — 7y
0
@adark you should rewrite your post as the answer. With a little tweaking it would work perfectly. shadownetwork 233 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

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

Ad

Answer this question