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

Touched event get point of contact?

I am trying to make an explosion for my projectile. How can get the point of contact when the touched event is fired? The touched event gives me the the part I hit. How can I get the exact point of contact.

script.Parent.Touched:Connect(function(hit)
    --get the point of contact
end)

2 answers

Not sure if it is possible, but there is a way around this. As soon as the part is touched, you could clone the explosion and set it's position to the part with the 'Touched' function connected to it.

script.Parent.Touched:Connect(function(hit)

local expl = game.ServerStorage.Explosion:Clone()
expl.Position = script.Parent.Position
expl.Parent = workspace





end)

If you are doing a projectile, id recommend ray casting over this as I believe it works for a point of contact (it works for me at least). Here are the docs on: Raycasting

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