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

Finding the exact location of a collision?

I'm trying to find the exact position of a collision, not the position of either part touching the other. I can't find an easy answer, and I think this might be due to my lack of knowledge on CFrames. I'm not very used to them yet, so I find it hard to create scripts that involve complex movement. Anyways, I want to know if there's a method I can use to find exactly where two parts touch. I'm not requesting an entire script, but maybe a couple of tips, links, or equations I can use to do this. Thanks.

1 answer

How about this? It should print the collision position not the bricks position because it's not touched.parent.

function collision(Position)
print("The Collision Happened at".. Position)
script.Parent.Touched:connect(collision)

3 comments

0

Didn't work. I told the script to print x, y, and z in the output, and it returns the part that touched it and two nil values.

0

This is exactly what I DIDN'T ask for. If you had done this right, it would've resulted in the position of the part it collided with, not the position of the collision.

0

Sorry, let me try again.

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