Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this script locking player movement?

Asked by
drew1017 330 Moderation Voter
8 years ago
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?

0
What do you mean by "facing almost perfectly forward or backward"? Discern 1007 — 8y
0
facing perfectly towards either direction on the Z axis. drew1017 330 — 8y
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. RoboFrog 400 — 8y
0
It's executed when the player presses the 1 key. And ill try that, let me get back to you. drew1017 330 — 8y
View all comments (2 more)
0
Set all surfaces to Unjoinable and the same thing happened. drew1017 330 — 8y
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 drew1017 330 — 8y

1 answer

Log in to vote
-1
Answered by
MrMedian 160
8 years ago

It is anchored.

0
This is the most helpful answer i have ever seen in my life. drew1017 330 — 8y
Ad

Answer this question