Making slash marks for weapon

Hey Devforum, how can i create slash marks on parts hit by the sword in my game? I want them to work similar to bullet holes with guns in FPS games.

1 Like

alr its not the best but it works

basically i create a decal in the hit part and i map the hitnormal to a normalId

local function getFaceFromNormal(normal)
	if normal == Vector3.new(0, 1, 0) then
		return Enum.NormalId.Top
	elseif normal == Vector3.new(0, -1, 0) then
		return Enum.NormalId.Bottom
	elseif normal == Vector3.new(1, 0, 0) then
		return Enum.NormalId.Right
	elseif normal == Vector3.new(-1, 0, 0) then
		return Enum.NormalId.Left
	elseif normal == Vector3.new(0, 0, -1) then
		return Enum.NormalId.Front
	elseif normal == Vector3.new(0, 0, 1) then
		return Enum.NormalId.Back
	end
	
	return Enum.NormalId.Front  -- Default face if none match
end

i might make it have a custom rotation

i think it would be better if you used flipbooks for that, they’d look a lot more cooler than a simple decal

1 Like

how would i put this flat on a part, though?

1 Like

eventually just made a bindable event script that placed an attachment at the hitposition of the raycast, then inserted a flipbook particle

1 Like