Slac3r
(Slac3r)
May 20, 2023, 3:17am
#1
I need help finding a good and reliable way other than touched events to trigger if my sword slashes a window. I’ve tried using touched events but the event doesn’t get triggered. Same for a hitbox. Any other reliable ways I can use to detect touch?
Video:
robloxapp-20230519-2015512.wmv (638.2 KB)
1 Like
Slac3r
(Slac3r)
May 20, 2023, 3:34am
#3
Didn’t know this existed, ill check it out. Thanks for the help!
1 Like
Slac3r
(Slac3r)
May 20, 2023, 4:01am
#5
After looking for some time, I can only see that this detects the humanoid and the parts in the characters model.
newHitbox.OnHit:Connect(function(hit, humanoid)
print(hit)
humanoid:TakeDamage(50)
end)
I can’t figure out how to change it to detect a part instead.
me7474
(me7474)
May 20, 2023, 4:14am
#6
Try changing the detection mode. Here is documentation:
And here is a code example:
newHitbox.DetectionMode = RaycastHitbox.DetectionMode.PartMode
you can use instance a part (for the sword slash hitbox) and use magnitude to see if its touching the window