I’m working on a grow mechanic for models. Sadly whenever I tween the model, only the meshParts in the model move with the PrimaryPart. The ‘‘sparklePart’’ (a normal part) doesn’t move at all. All parts are welded to the PrimaryPart in the exact some way.
Can someone explain why this happens?
ServerScript
local function spawnCrystal(Model,originalSpawn)
Model = serverStorage.Archived.Assets.Crystals['2 Crystal Blue']:Clone()
Model.Parent = workspace
Model.Parent = workspace
Model:PivotTo(CFrame.new(originalSpawn))
local tweenInfo = TweenInfo.new(6,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
local rayOrgin = Model:GetPivot().Position
local rayDirection = Vector3.new(0,-100,-0)
local rayParams = RaycastParams.new()
rayParams.FilterType = Enum.RaycastFilterType.Whitelist
rayParams:AddToFilter(workspace.Terrain)
local result = workspace:Raycast(rayOrgin,rayDirection,rayParams)
if result then
local placePosition
if tonumber(string.sub(Model.Name,1,1)) >= 2 then
placePosition = result.Position + Vector3.new(0,Model:GetExtentsSize().X/10*4,0)
else
placePosition = result.Position + Vector3.new(0,Model:GetExtentsSize().X/10*7.5,0)
end
Model:PivotTo(CFrame.new(placePosition - Vector3.new(0,5,0)))
for _, Emitter in ipairs(Model.sparklePart.growVFX:GetChildren()) do
Emitter.Enabled = true
end
local growTweenModel = tweenService:Create(Model.PrimaryPart,tweenInfo,{CFrame = CFrame.new(placePosition)})
growTweenModel:Play()
growTweenModel.Completed:Wait()
task.wait(4)
for _, Emitter in ipairs(Model.sparklePart.growVFX:GetChildren()) do
Emitter.Enabled = false
end
end
end
The closed meshPart is the primaryPart.
All parts move, except the sparklePart.