I’m trying to make a wallrun but the ray I’m using can only hit 1 side of a part. I haven’t been able to find anything about it. Everything is currently done in a local script.
Code:
local plr = game.Players.LocalPlayer
local chr = plr.Character or plr.CharacterAdded:Wait()
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(I,G)
if G == false then
if I.KeyCode == Enum.KeyCode.Space then
local RP = RaycastParams.new()
RP.FilterType = Enum.RaycastFilterType.Blacklist
RP.FilterDescendantsInstances = {chr}
local ray = workspace:Raycast(chr.HumanoidRootPart.Position,(chr.HumanoidRootPart.CFrame * CFrame.new(2,0,0)).Position,RP)
workspace.RayPart.CFrame = chr.HumanoidRootPart.CFrame * CFrame.new(2,0,0)
if ray and ray.Instance then
warn("HIT")
end
end
end
end)