What do you want to achieve?
raycast-based explosion system
What is the issue?
it does cast rays, but its like misses the character, but if i put the character like on top (close) of the explosion part, it still doesn’t work, here’s the video upload.systems | RobloxStudioBeta_f73fQh9lWD.mp4
What solutions have you tried so far?
tried recreating my damage system and ifDamagable function
also tried searching on devforum but didn’t really help
-- doesn't really want to send the entire script but here's what could help
local function isDamageablePart(part)
if part:IsA("BasePart") or
part.Parent == nil or
part.Parent == workspace.Terrain or
part == script.Parent then
return false
end
-- Look directly for the character containing a humanoid
local character = part:FindFirstAncestorWhichIsA("Model")
if character and character:FindFirstChildWhichIsA("Humanoid") then
return true
end
return false
end
whats this for? character’s parts such as right arm torso etc counts as basepart too, with the way it is rn it wouldn’t return true even if it directly hits a character
that raycast is just not suitable for some explosion like that, the solution i gave isn’t about the way u make raycasts but about when the raycast hits. so as long as the raycast doesn’t hit the solution i gave you would not work.
i wouldn’t suggest detecting if player is in the explosion zone or not with raycasts
Hello, you could use workspace:GetPartBoundsInRadius(), and then check if the parts are players. If they are, ray cast the distance and if it doesn’t hit anything, they take damage.