I am trying to scale this model up, to be used as a projectile
However, it ends up like this when I scale it using the code (it also has a primary part, namely the spear’s handle shown below) :
Its hierarchy is here, all the spear’s parts are initally welded to the tool handle while being inside a separate model within the tool itself
All the code used to scale the model:
(Note that this is done on a localscript)
local localscript = script
local projectiletype = localscript:WaitForChild("Type").Value
local tool = localscript:WaitForChild("Tool").Value
local proxy = localscript:WaitForChild("Proxy").Value
ball = Instance.new("Part")
local emitter,sound = tool.SpearModel.Handle.Sparkler:Clone(),tool.SpearModel.Handle.BellToll:Clone()
emitter.Enabled = false
emitter.Parent = ball
sound.Parent = ball
ball.Shape = Enum.PartType.Ball
ball.Color = Color3.fromRGB(255,255,255)
ball.Size = Vector3.new(3,3,3)
ball.Material = Enum.Material.Neon
ball.Anchored = true
ball.CanCollide = false
ball.CastShadow = false
ball.CanQuery = false
ball.CanTouch = false
ball.Transparency = .3
if projectiletype == 1 then
projectile = ball:Clone()
projectile.Size = Vector3.new(1,1,1) * .75
projectile.Transparency = .25
game:GetService("TweenService"):Create(projectile,TweenInfo.new(.5,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),{Transparency = 0})
else
projectile = tool.SpearModel:Clone()
local handle = projectile.Handle
handle.Sparkler.Enabled = true
handle.Anchored = true
local sizemulti = 5
projectile:BreakJoints()
local cf = projectile.PrimaryPart.CFrame
game:GetService("TweenService"):Create(handle,TweenInfo.new(.5,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),{Transparency = 0.5}):Play()
for _,v in ipairs(projectile:GetDescendants()) do
if v:IsA("BasePart") then
v.Anchored = true
v.Size = v.Size * sizemulti
if v ~= projectile.PrimaryPart then
v.CFrame = (cf + cf:inverse() * v.Position * sizemulti)
end
local tween = game:GetService("TweenService"):Create(v,TweenInfo.new(.5,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),{Transparency = 0.25})
tween:Play()
end
end
end
local projsparkler = projectile:FindFirstChild("Sparkler",true)
if projectile.Name == "Part" then
projectile.CFrame = proxy.Value
else
projectile:PivotTo(proxy.Value)
end
projectile.Parent = workspace.FilterableMapDeco
task.spawn(function()
wait(1)
projsparkler.Enabled = true
end)
if projectile.Name == "Part" then
proxy.Changed:Connect(function(newcf)
projectile.CFrame = newcf
end)
else
proxy.Changed:Connect(function(newcf)
projectile:PivotTo(newcf)
end)
end
I’ve cut out the clean-up bit for the sake of being short, I dont think it was important anyways