the raycast isn't returning anything
local humanoidrootpart:BasePart = player.Character.HumanoidRootPart
local explosionmodule = require(game.ServerScriptService.ExplosionModule)
local direction = (mousepos - humanoidrootpart.Position).Unit * 1000
local params = RaycastParams.new()
params.FilterDescendantsInstances = {player.Character}
params.FilterType = Enum.RaycastFilterType.Exclude
local raycastresult = workspace:Raycast(mousepos, direction, params)
if raycastresult then
local initialpos = Vector3.new(humanoidrootpart.Position.X, humanoidrootpart.Position.Y + 50, humanoidrootpart.Position.Z)
explosionmodule.Explosion(
Color3.fromHex("0000ff"),
ColorSequence.new(Color3.fromHex("0000ff")),
1, raycastresult.Position,
initialpos, 2.5,
Enum.EasingStyle.Sine
)
end
end)```