It’s not a matter of being “extremely dumb,” programming can be tricky sometimes! I’ll do my best to help you out.
To assign RaycastParams to a Ray, you can create a new RaycastParams object and then assign it to the RaycastHitParams property of the Ray. Here’s an example:
local cam = game.Workspace.CurrentCamera
local ray = cam:ViewportPointToRay(Vector2.new(0.5, 0.5))
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Blacklist
params.FilterDescendantsInstances = {game.Workspace.Zombie}
local hit = game.Workspace:Raycast(ray.Origin, ray.Direction, params)
if hit then
print("Zombie detected in the middle of the screen!")
end
In this example, I created a new RaycastParams object and set its FilterType to Blacklist and its FilterDescendantsInstances to an array containing the Zombie instance in the Workspace. This means that the ray will ignore the Zombie instance when checking for collisions.
Then, I used the Raycast method on the Workspace to check if the ray hit anything. If it did hit something, the hit variable will contain a RaycastResult object, which you can use to get information about the hit object and the location of the hit.
I hope this helps! Let me know if you have any more questions.