it doesn’t look like i’ll get a working answer soon, so i’ll check if the last resort method involving welds works, in case there’s other people who are experiencing the same problem, but are open to using welds. if it does, i’ll post it here, but not mark it as a answer because it doesn’t fit this topic.
e: here it is. this works for both Welds and WeldConstraints, but i think the latter is more preferable. it’s important that the weld gets disabled first before anchoring so that the character doesn’t get dragged along with it when it’s super far away, unless you’re using a different method to hide the part (i.e, setting transparency to 0). i used the “teleport part super far away” method because it was mentioned that CFrame is “a fast property” to change.
local Player = game.Players.LocalPlayer
local Character = nil
if Player.Character and Player.Character.Parent then
Character = Player.Character
else
Player.CharacterAdded:Wait()
end
local Tool = script.Parent
local Active = false
local function Attach()
script.Visual.Anchored = false
script.Visual.CFrame = Character["Right Arm"].CFrame
script.Visual.WeldConstraint.Part1 = Character["Right Arm"]
script.Visual.WeldConstraint.Enabled = true
end
local function Detach()
script.Visual.WeldConstraint.Enabled = false
script.Visual.CFrame = CFrame.new(Vector3.new(0, math.huge, 0))
script.Visual.Anchored = true
end
local function Start()
Active = true
Attach()
end
local function Stop()
Active = false
Detach()
end
Tool.Activated:Connect(Start)
Tool.Deactivated:Connect(Stop)
Tool.Unequipped:Connect(Stop)
game["Run Service"].RenderStepped:Connect(function(DT:number)
if Active then
script.Visual.CFrame = Character["Right Arm"].CFrame
end
end)
e2: this should be the last edit unless i make another mistake and find out about it. i was rushing on the 1st edit, so i didn’t explain how it works, mostly.
before i get into it, i have to mention using CFrame or both Position and Orientation seem to have different behaviours. i made a test where a part stretches out from the character’s humanoid root part to a clicked position & attached that to the humanoid root part via a WeldConstraint, with the part adapting to the difference in distance and the movement of the humanoid root part by setting it’s position & rotation in a RenderStepped function. using CFrame, the character gets stuck or have glitchy camera-desyncing movement, because (i think) CFrame moves whatever’s connected to the part along with it. using Position & Orientation avoids the problem that occurs when using CFrame.
the script works by setting the part’s position & orientation via cframe, setting anchored to false, then attaching the weld to the part the moment the tool is activated, and doesn’t have to change the positioning & rotation of the part afterwards because it’s goal was to just sync the position & rotation relative to the character’s right arm. upon deactivation, the weld is detached by disabling it, the part is hidden by placing it far away (which helps in keeping it’s transparency property to whatever it was since the script isn’t hiding it by setting it to 1), and is finally anchored so that it doesn’t eventually fall to the void to prevent it from being deleted.
because of the traits mentioned eariler, if you want to change the position and/or orientation relative to the attached part in a RenderStepped function while a WeldConstraint is attached, set the part’s Position & Orientation property instead of using CFrame so that the part intended to be used as a visual effect is the only object moved by the script.