Prevent player from flicking to anchored tool on equip

Currently, I’m working on a system where if a player picks up a tool that is anchored, since it plays a constant looping spinning animation where it floats in midair before being picked up. it unanchores itself and equips it.

Spin script:

while true do
	if script.Parent.Parent.Parent:FindFirstChild('Humanoid')==nil and script.Parent.Parent.Parent.Name~="Backpack" then
		script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAnglesXYZ(0,0,0.03)
	else
		script.Parent.Anchored = false
	end
	task.wait(0.05)
end

Currently I have this, which works unless you stop moving in which case itll flop the player to the floor for the single frame the weapon remains anchored.

script.Parent.Equipped:Connect(function()
    script.Parent.Handle.Anchored = false
end)

TLDR; Weapon is anchored to play an animation midair. But because players just flick to a tool & freeze when equipping an anchored tool it becomes tedious to fix this issue.

1 Like

is this in a serverscript or localscript? and Is everything in the tool unanchored?

ServerScript, tool consists of singular handle which has a mesh in it. The handle is anchored.

can you send a screenshot of the meshes properties?

I don’t see how the meshs’ properties would be relevant here.
The part itself is a regular part except it’s anchored.

that’s not exactly how i would go for it, first off unanchor the tool, there’s no need to do unnecessary workarounds to unanchor it everytime a player equips it. how i would go about it, everytime a player get near the tool, you first play the spinning animation, then unanchor the tool and give it to the player.

there cant be anything anchored in the tool or the players character will be forced to it.

Yes, that’s the problem I’m trying to solve. Please read my original post.
Edit: Edited the og post to include more info

you have to work around it you literally cant prevent it

1 Like

just unanchor it as soon as the player picks it up

script.Parent.Parent.Equipped:Connect(function()
      script.Parent.Anchored = false
end)

That is what I do, though for some reason this issue fixed itself after I restarted the game a bit. If it happens again I’ll keep you posted with more details.

3 Likes

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