hello everyone. today, i’m just curious how i could scale a weld’s c0 and c1 properties based on a scale. confused? let me explain…
i am creating a viewmodel. i am trying to make it not clip through walls, and viewport frames are so easily noticeable and have an unavoidable one-pixel outline. instead, i am using the method discussed here to create the illusion of no viewmodel clipping. just one issue; because i am using a system which requires the tool to be inside of the character (and not the viewmodel) at all times, i need to also scale it along with the viewmodel, meaning that roblox does not automatically handle the weld adjustments!
my little short code snippet:
local scale = 0.2
local offset = Vector3.new(0, -2, 0)
runservice:BindToRenderStep("Viewmodel", Enum.RenderPriority.Camera.Value, function()
update_animations()
local tool = char:FindFirstChildOfClass("Tool")
if tool then
tool:ScaleTo(0.2)
end
viewmodel:ScaleTo(scale)
viewmodel:PivotTo(camera.CFrame * CFrame.new(offset * scale))
end)
pretty clear issue here. any help would be greatly appreciated! thanks for reading.