Argument 3 missing or nil on position values


while true do

	for i , v in pairs(script.Parent.Parent.Range:GetTouchingParts()) do
		print("c")
	
			local a = v:FindFirstChild("Aim")
			script.Parent.Parent.Union.CFrame = CFrame.Angles(Vector3.new(a.WorldPosition.X , script.Parent.Position.Y , a.WorldPosition.Z))
			print("a")
			end
		
	wait(0.1)
	print("b")
end



It gives me the error on title despite “Aim” being an attachment with x y and z positions

2 Likes

[quote=“boyparis, post:1, topic:1145493”]

			script.Parent.Parent.Union.CFrame = CFrame.Angles(Vector3.new(a.WorldPosition.X , script.Parent.Position.Y , a.WorldPosition.Z))

Change to

script.Parent.Parent.Union.CFrame = CFrame.Angles(a.WorldPosition.X , script.Parent.Position.Y , a.WorldPosition.Z)
3 Likes

ok, it worked, but the hingeconstraint went crazy instead of turning the right way.

1 Like

Oh I think you meant this:

script.Parent.Parent.Union.CFrame = CFrame.new(a.WorldPosition.X , script.Parent.Position.Y , a.WorldPosition.Z)

no i wanted the union to poin toward the attachment only on the x and z axis

nvm fixed it by changing cframe.angles for cframe.new with unionsposition then a vector3 containing the attachment´s x and z coordinates