-
What do you want to achieve? I’m trying to set the worldposition of an attachment to the position of a part inside the player’s viewmodel
-
What is the issue? The returned position of said part inside the player’s viewmodel is inaccurate
The code looks like this
game:GetService("RunService").RenderStepped:Connect(function()
viewmodel.HumanoidRootPart.CFrame = game.Workspace.Camera.CFrame
if updateSpring then
visualAtt0.WorldPosition = viewmodel.Right.Core.Position - Vector3.new(0,0,0)
print(visualAtt0.WorldPosition, "att0 worldpos")
print(viewmodel.Right.Core.Position, "right.core position")
print()
end
end)
- What solutions have you tried so far? I tried adding an offset to set attachment worldposition (the vector3 would do just that), but as the player pans the camera around this offset quickly becomes inaccurate: if I offset the Y by -1 the set position would be acceptably accurate, but only if the player looked completely horizontally. (I could however try to do
this, but it takes quite a lot of time to get that down)
I don’t know what is causing the returned position to be inaccurate