I need help making my anti clipping for my gun system smooth as how it is now is not good enough.
- What is the issue? Include screenshots / videos if possible!
- What solutions have you tried so far? Did you look for solutions on the Creator Hub?
I have tried many I even tried rewriting my whole Bind to render step code to hopefully fix it, I’ve hunted the forums but there doesn’t seem to be a topic that covers this issue
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Just in case you want the code in a non Screenshot form:
--// Anti Clipping
local Params = RaycastParams.new()
Params.FilterType = Enum.RaycastFilterType.Exclude
Params.FilterDescendantsInstances = {Char, Viewmodel}
local ray = workspace:Raycast(workspace.CurrentCamera.CFrame.Position, workspace.CurrentCamera.CFrame.LookVector * 5, Params)
if ray then
viewmodelCF *= viewmodelCF:Lerp(CFrame.new(-0.3, 0, 0))
end
--// Apply CFrame to Viewmodel
local MainPivot = Gunmodel:FindFirstChild("Core").Handle or Gunmodel.PrimaryPart
Viewmodel:PivotTo(workspace.CurrentCamera.CFrame * viewmodelCF * BobCF * JumpCF) --// Add AimCF & CrouchCF when I implement it
MainPivot.CFrame *= CFrame.Angles(updateSwaySpring.Y, updateSwaySpring.X, 0)
