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

BodyPosition used in projectile is parenting, but doesn't work?

Asked by 3 years ago

I am using BP in a projectile, and I'm trying to get a jump/hold in the air kind of effect. And so I scripted it out, and added aiming (with BG). I expected it to work, and I tested and it just didn't position. It's where I want it to be (parented) but it just doesn't work for some reason. Help!

local Charge = 0

        local BG = Instance.new("BodyGyro")
        BG.Parent = Char.HumanoidRootPart
        BG.MaxTorque = Vector3.new(250000,250000,250000)
        BG.CFrame = CFrame.new(Char.HumanoidRootPart.Position, Mouse.Hit.p)
        BG.P = 25000
        BG.D = 140

    local BP = Instance.new("BodyPosition")
    BP.Parent = Char.HumanoidRootPart
    BP.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
    BP.Position = Char.HumanoidRootPart.Position
    BP.P = 15000
    BP.D = 1250

    script.Function:FireServer(Mouse.Hit.p)

        while BtnDown == true and Charge < 60 do
            BG.CFrame = CFrame.new(Char.HumanoidRootPart.Position, Mouse.Hit.p)
            Charge = Charge + 1
            wait()
        end
    BG:Destroy()
    BP:Destroy()
        ButtonEvent:FireServer()
0
Any errors? Does the BodyGyro work but just not the BodyPosition? Sparks 534 — 3y
0
Oh... Is this the same one lol Sparks 534 — 3y
0
Yeah.. I thought I would make a new post XxWingKing 96 — 3y

Answer this question