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

How to get the face of a touched part as a NormalId or Vector3 orientation?

Asked by
nc2r 117
5 years ago
Edited 5 years ago

A NormalId is an enum for the 6 faces of a cube. Suppose I have a part that is triggered by a touched event. This script is in a projectile

script.Parent.Touched:Connect(function(Hit)
--How to return a NormalId corrosponding to the face that was hit?
--OR
--How to return a Vector3 corrosponding to the orientation of the face?
local Part = Instance.new("Part", workspace)
Part.Size = Vector3.new(10, 0, 10)
Part.Position = script.Parent.Position
Part.Oreentation = ? -- how to make it parrallel with the hit surface
end)

I am trying to just create a very thin part that is parallel to the surface that it hit

Answer this question