Hello! I am trying to make an effect like this where the balls follow you around until you release them. However, mine just stay there without moving. Here’s my code:
local demonfolder = Instance.new("Folder", workspace)
demonfolder.Name = Model.Name..":DemonFireballs"
local player = game.Players[Model.Name]
local fire1 = Assets.FireStorm:Clone()
local cfv1 = Instance.new("CFrameValue", fire1)
cfv1.Value = CFrame.new(math.random(-5,5), math.random(0,5), math.random(1, 5))
fire1:SetPrimaryPartCFrame(Model.HumanoidRootPart.CFrame * cfv1.Value)
fire1.Parent = demonfolder
fire1.Name = "FireStorm1"
local fire2 = Assets.FireStorm:Clone()
local cfv2 = Instance.new("CFrameValue", fire2)
cfv2.Value = CFrame.new(math.random(-5,5), math.random(0,5), math.random(1, 5))
fire2:SetPrimaryPartCFrame(Model.HumanoidRootPart.CFrame * cfv2.Value)
fire2.Parent = demonfolder
fire2.Name = "FireStorm2"
local fire3 = Assets.FireStorm:Clone()
local cfv3 = Instance.new("CFrameValue", fire3)
cfv3.Value = CFrame.new(math.random(-5,5), math.random(0,5), math.random(1, 5))
fire3:SetPrimaryPartCFrame(Model.HumanoidRootPart.CFrame * cfv3.Value)
fire3.Parent = demonfolder
fire3.Name = "FireStorm3"
local fire4 = Assets.FireStorm:Clone()
local cfv4 = Instance.new("CFrameValue", fire4)
cfv4.Value = CFrame.new(math.random(-5,5), math.random(0,5), math.random(1, 5))
fire4:SetPrimaryPartCFrame(Model.HumanoidRootPart.CFrame * cfv4.Value)
fire4.Parent = demonfolder
fire4.Name = "FireStorm4"
local fire5 = Assets.FireStorm:Clone()
local cfv5 = Instance.new("CFrameValue", fire5)
cfv5.Value = CFrame.new(math.random(-5,5), math.random(0,5), math.random(1, 5))
fire5:SetPrimaryPartCFrame(Model.HumanoidRootPart.CFrame * cfv5.Value)
fire5.Parent = demonfolder
fire5.Name = "FireStorm5"
for i, v in pairs(demonfolder:GetChildren()) do
Model.HumanoidRootPart:GetPropertyChanedSignal("CFrame"):Connect(function()
v:SetPrimaryPartCFrame(Model.HumanoidRootPart.CFrame * v.CFrameValue.Value)
end)
end
You just need to edit the C0 of the weld. For example if you do
weld.C0 = CFrame.new(5, 0, 0)
that will make the ball be welded 5 studs to the right of the humanoid root part instead of directly in the center, mess with that cframe value and you can get them to the same position as the video you showed
To me this looks like a bunch of unnecessary code since roblox has already made stuff to do this for you. I think there r constraints called ‘AlignPosition’ for more binding following balls,or if u want some drag use body position. if I missunderstood the question then sort but its like midnight and im about to sleep
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
for i,v in pairs(script.Parts:GetChildren()) do
local Part = v:Clone()
Part.Parent = Character
local Attachment1 = Character.HumanoidRootPart:WaitForChild("RootRigAttachment")
local Attachment0 = Part:WaitForChild("Attachment1")
local AlignPosition = Instance.new("AlignPosition")
AlignPosition.Parent = Part
AlignPosition.Attachment0 = Attachment0
AlignPosition.Attachment1 = Attachment1
local AlignOrientation = Instance.new("AlignOrientation")
AlignOrientation.Parent = Part
AlignOrientation.Attachment0 = Attachment0
AlignOrientation.Attachment1 = Attachment1
end
end)
end)
Hi! This is really cool, thank you. How can you make the item follow you upon equiping a tool or reaching a stat or level for example? I’ve tried so many different combinations I can only get it to give it to a player if you start off with a stat not while playing and reaching a stat or not even when an tool is equiped.
Im still a beginner. I’ve tried so many edits, I can only get it to work if I start off with a tool equipped or a stat. But I’m still trying, will look into that.