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

Finding the exact location of a collision?

Asked by 9 years ago

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

Log in to vote
-1
Answered by
yoshiegg6 176
9 years ago

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)
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. Minifig77 190 — 9y
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. aquathorn321 858 — 9y
0
Sorry, let me try again. yoshiegg6 176 — 9y
Ad

Answer this question