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

How to make part stay beside a player?

Asked by 4 years ago

My part is moving in front of my character, how would I stop that. The code:

local Position

game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        script.Parent.BodyPosition.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
        script.Parent.BodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
        while wait() do
            Position = Vector3.new(character.LowerTorso.Position.X - 3, character.Head.Position.Y, character.LowerTorso.Position.Z)
            script.Parent.BodyPosition.Position = Position
            script.Parent.BodyGyro.CFrame = character.LowerTorso.CFrame
        end
    end)
end)
0
I don't see anything wrong with this. Please post a video explaining what the issue is. I tested in studio, and works just like a pet would in a simulator or whatever you're making. 2Loos 168 — 4y

Answer this question