Basically I have tons of parts, and I want them all to conform together to make something that looks equivalent to one part. I have this code inside every part:
local charge = object.Charge
local RS = game:GetService("RunService")
local TS = game:GetService("TweenService")
RS.Heartbeat:Connect(function()
local region = Region3.new(object.Position-Vector3.new(15,15,15),object.Position+Vector3.new(15,15,15))
local parts = workspace:FindPartsInRegion3(region)
for i,v in pairs(parts) do
if v.Name == "Proton" then
if v.Anchored == false then
local tweentime = ((v.Size.X*v.Size.Y*v.Size.Z)*(v.Position-object.Position).Magnitude)/100
local tween = TS:Create(v,TweenInfo.new(tweentime),{Position=object.Position})
tween:Play()
end
end
end
end)
maybe the Body forces P value is too low? i have no experiences with body force but with body velocities the P determines how much force is exerted on a part
local charge = object.Charge
local RS = game:GetService("RunService")
local TS = game:GetService("TweenService")
RS.Heartbeat:Connect(function()
local region = Region3.new(object.Position-Vector3.new(15,15,15),object.Position+Vector3.new(15,15,15))
local parts = workspace:FindPartsInRegion3(region)
for i,v in pairs(parts) do
if v.Name == "Proton" then
if v.Anchored == false then
local tweentime = ((v.Size.X*v.Size.Y*v.Size.Z)*(v.Position-object.Position).Magnitude)/100
print("Code found proton, tweenTime is "..tweentime)
local tween = TS:Create(v,TweenInfo.new(tweentime),{Position=object.Position})
tween:Play()
end
end
end
end
If the print statement doesn’t run then there aren’t parts named Proton that are in the region and unanchored.
If the tween time is huge maybe the tween is just running very slowly.