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

Velocity not working. Are we able to add velocity to a model's child?

Asked by 5 years ago
game.StarterPack.RemoteEventG.OnServerEvent:Connect(function(plr, hit)
    plr.XP.Value = plr.XP.Value + 350
    wait(0.1)
    local x = game.ReplicatedStorage.FireG:Clone()
    x.Parent = workspace
    x.G1.CFrame = plr.Character.HumanoidRootPart.CFrame*CFrame.new(-4, 0.5, 2)
    x.G2.CFrame = plr.Character.HumanoidRootPart.CFrame*CFrame.new(-3, 3.5, 2)
    x.G3.CFrame = plr.Character.HumanoidRootPart.CFrame*CFrame.new(0, 4.5, 2)
    x.G4.CFrame = plr.Character.HumanoidRootPart.CFrame*CFrame.new(3, 3.5, 2)
    x.G5.CFrame = plr.Character.HumanoidRootPart.CFrame*CFrame.new(4, 0.5, 2)
    for i = 1, 10 do
        wait(0.055)
        x.G1.Transparency = x.G1.Transparency - 0.1
        x.G2.Transparency = x.G2.Transparency - 0.1
        x.G3.Transparency = x.G3.Transparency - 0.1
        x.G4.Transparency = x.G4.Transparency - 0.1
        x.G5.Transparency = x.G5.Transparency - 0.1
    end
    local v = Instance.new("BodyVelocity")
    v.Parent = x.G1
    v.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
    v.Velocity = (x.G1.Position-hit.p).unit*165
    wait(0.1)
end)

I used the same thing for velocity but the only difference is it wasn't in a model.

Answer this question