Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why is this script locking player movement?

function Shield()
	local cooldown = 17.5
	local up = player.Character.S1up.Value
	local parts = player.Character:GetChildren()
	for i, v in pairs(parts) do
		if v:IsA('BasePart') then
			local shield = Instance.new('Part', v)
			shield.CanCollide = false
			shield.Material = Enum.Material.Neon
			shield.Size = v.Size
			shield.Anchored = true
			shield.Position = v.Position
			shield.Color = Color3.new(0, 0, 0)
			shield.Transparency = 0.6
		end
	end
end

As you can see, i'm trying to make a shield effect on a player's character (I know its anchored, i've just started it). It works as expected, but if you're facing almost perfectly forward or backward, using it locks you in place. I suspect it could be because it's making a joint on the player, but i'm not sure how I would prevent that, and that might not be whats happening. Could anyone help me fix this?

6 comments

0

What do you mean by "facing almost perfectly forward or backward"?

0

facing perfectly towards either direction on the Z axis.

0

When is this script executed? (as in when they spawn, or when they step on a button, et cetera) Also, try setting the faces of the newly created part only to smooth.

0

It's executed when the player presses the 1 key. And ill try that, let me get back to you.

0

Set all surfaces to Unjoinable and the same thing happened.

0

Okay BreakJoints() in the command bar caused the part to fall off but putting that in the script wont work for whatever reason, so I need to somehow prevent joints from being made

1 answer

It is anchored.

1 comment

0

This is the most helpful answer i have ever seen in my life.

This discussion is preserved as it was. New answers, comments, and votes are closed.