Hi, so i’m working on a wall sliding system currently, and the wall detection works fine, the character moves to the position of the Raycast result (Raycast.Position), but the problem is that he clips inside the part, which is not what i want. I want the character to be 0.5 studs away from the wall, so as to make him not look like he’s stuck inside the wall but rather against the wall, but i can’t seem to figure it out. Sorry if this is something really simple and i shouldn’t have to make a post about this, i’m just really, really not good at physics and stuff.
Code:
local WJRaycast = workspace:Raycast(Root.Position, Root.CFrame.LookVector * 2, WJParams)
if WJRaycast then
if WJRaycast.Instance then
Root.Anchored = true
Root.CFrame = CFrame.new(WJRaycast.Position, WJRaycast.Position + WJRaycast.Normal)
WJAnim:Play()
break
end
end
How it looks currently:

How i want it to look:
