Enum type cannot be assigned to

So i am learning raycasting from the mouse to the game space…

local PLAYER = game.Players.LocalPlayer
local MOUSE = PLAYER:GetMouse()
MOUSE.Button1Down:Connect(function()
	local WORLD_CAMERA = workspace.CurrentCamera
	local RAY_PARAMS = RaycastParams.new()
	RAY_PARAMS.IgnoreWater = true
	RAY_PARAMS.FilterType.EnumType = Enum.RaycastFilterType.Exclude
	RAY_PARAMS.FilterDescendantsInstances = {script.Parent}
	local LOOK_CAMERA = WORLD_CAMERA.CFrame.LookVector
	local RAY_RESULT = workspace:Raycast(WORLD_CAMERA.CFrame.Position, WORLD_CAMERA.CFrame.LookVector * 14, RAY_PARAMS)
	print(RAY_RESULT.Instance.Name)
	RAY_RESULT.Instance.Color = Color3.new(1,1,1)
end)

I want so that if i click left click then i turn the part to color white? or black? but ofc the error says Enum type cannot be assigned to…

LOCATION OF SCRIPT: game.starterplayer.starterplayerscript
NAME OF SCRIPT: RAY_CAST_TEST - LOCAL SCIPT

Its supposed to be just Params.FilterType = Enum.RaycastFilterType

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.