How do i 'link' 2 cframes

so… I am making a module script containing funcs that are a must for magic, so one of them was placing the fx such that when the player moves it should also move this is what i got so far ~

module.link = function(fx,hrp,Offset,Type)
	if Type == "CFrame" then
		fx.CFrame = hrp.CFrame + Offset
end
end

the only problem is that if i were to move the char, the vfx doesnt move with it; I was wondering how i could achive this please reply below

You can use RunService and constantly call that function to continuously set the CFrame.

well is there a way to detect any change in the cframe that would reduce lag by quite a bit rather then using runservice

Well detecting a change each frame would still require a run service bind, but chances are the player will move their character so the check is mostly useless.

You can use welds to attach a part to another part, in your case, you can attach the VFX to the character’s root part for example.

local weld = Instance.new("Weld")
weld.Part0 = character.HumanoidRootPart
weld.Part1 = vfx
weld.C0 = offset
weld.Parent = vfx
1 Like

I am locking the char so they wont move till a certain time period