Hello, I want to create a beam that when he touch the boss, the boss is hurt. But i don’t know how to make the detection when the beam part and humanoidrootpart of the boss (they are anchored and the beam part don’t have collision).
Are you saying you want the boss to take damage when the player is hit by the beam? An easy option for you is to raycast from where the beam starts, to the direction it is going.
No, I want the beam to take damage when the beam passes over it, but I don’t know how to do it because both parts are anchored and collision is disabled.
Oh, do you mean when the beam passes over the boss? You can make a raycast from where the beam starts and in the direction it is going and check if the instance from the result is a child of the boss. Then, deal damage.
local handAttachment = workspace.Hand.Attachment
local boss = workspace.Boss
game["Run Service"].Heartbeat:Connect(function()
local result = workspace:Raycast(handAttachment.WorldPosition, handAttachment.WorldCFrame.LookVector * 100)
if not result or result.Instance.Parent ~= boss then return end
print("Hitting Boss")
end)
Here’s some code that can help you out, just make sure to turn the attachment like shown in the video.