How to find the position on the right of the player?

I need to raycast if there is a wall on the left or the right of the player and I haven’t figured out how to do so. I tried usin this code

local raycastResult = workspace:Raycast(game.Players.LocalPlayer.Character.HumanoidRootPart.Position, (game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.RightVector * Vector3.new(2,2,2)))

but it doesn’t seem to work.
I’m trying to make a parkour game and making a wall walking / running script and need to know which side the wall is on and I don’t know how to make the player get forced to be stuck on the wall and forced to move forward. All I need now is to be able to raycast to the left and right.

How does it not work? Have you tried making the raycast longer? Two studs to the right from the center of the rootpart is barely any distance

Also have you tried blacklisting the ray from detecting the localplayer’s character?

local Players = game:GetService'Players'
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character
local RootPart = Character:WaitForChild'HumanoidRootPart'

local Params = RaycastParams.new()
Params.FilterType = Enum.RaycastFilterType.Blacklist
Params.FilterDescendantsInstances = {Character}

while true do
	local RaycastResult = workspace:Raycast(RootPart.Position, RootPart.CFrame.RightVector * 2, Params)
	print(RaycastResult)
	wait(0.5)
end

Works ^

Sorry, but it still doesn’t work. I changed it and it won’t print.
it gives me an error:
image

May I see the whole script that you use to check for walls?

Nevermind the script works now, Sorry for the trouble.