Attachment CFrame Going Crazy

i have a game where players have a gui to select attachments, when an attachment is selected script reads some values etc. and then uses a module to attach the attachment, but if i attach 2 different types of attachments (like scope + supressor) the one thats added later just breaks and spawns far away. heres the source file to my place;

cfar.rbxl (269.1 KB)

how can i fix it? i tried multiple solutions thats why the scripts uses more values than they should do, can someone try to fix it or maybe tell me some ways to do it please? i was really hoping that i would be able to make a good attachment system, i solved many bugs and now im stuck here, i tried using WorldCFrame, CFrame, Position, Parenting the attachment to attacpart, parenting the attachment to parent of attacpart… and some more solutions

please help me!

guys… please help me… i dont wanna see attachments positioned 5000 studs away in my dreams… im going crazy… i tried 20 solutions, asked google, asked in devforum twice, asked in 5 biggest development servers in discord and still no solution… i wanna sleep!

Fixed, you just have to set the PivotOffset.

File:
cfar.rbxl (268.7 KB)

I only changed the code in GAS so you can take a look, and sorry if it doesn’t work, I only had 5 minutes.

1 Like

IT WORKS you are the goat man, thanks!

1 Like
while wait(1) do
	if script.Parent.Parent:FindFirstChild("Silencertype") then
		script.Parent.CFrame.Position = script.Parent.Parent.Silencertype.firepos.WorldPosition
	end
end

hey man, so im trying to set firepart’s position to a Attachment’s position in the silencer part, but it changes gun’s orientation too, i dont really need the orientation at all, i just have to set its position or CFrame to the silencer’s firepos because bullets hould come out of the silencer , but it doesnt works, can you help?

script is in the firepart, firepart is in the gun model, silencer is in the gun model too.

nevermind i fixed it by using Worldposition

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.